Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | //===-- llvm/CodeGen/MachineInstr.h - MachineInstr class --------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 84e66db | 2007-12-29 19:59:42 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains the declaration of the MachineInstr class, which is the |
| 11 | // basic representation for all target dependent machine instructions used by |
| 12 | // the back end. |
| 13 | // |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #ifndef LLVM_CODEGEN_MACHINEINSTR_H |
| 17 | #define LLVM_CODEGEN_MACHINEINSTR_H |
| 18 | |
Dan Gohman | 221a437 | 2008-07-07 23:14:23 +0000 | [diff] [blame] | 19 | #include "llvm/ADT/alist.h" |
Chris Lattner | d37bfbd | 2007-12-30 04:40:25 +0000 | [diff] [blame] | 20 | #include "llvm/CodeGen/MachineOperand.h" |
Dan Gohman | 1fad9e6 | 2008-04-07 19:35:22 +0000 | [diff] [blame] | 21 | #include "llvm/CodeGen/MachineMemOperand.h" |
Dan Gohman | 5cafec8 | 2008-05-29 19:52:31 +0000 | [diff] [blame] | 22 | #include <vector> |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 23 | |
| 24 | namespace llvm { |
| 25 | |
Chris Lattner | 5b93037 | 2008-01-07 07:27:27 +0000 | [diff] [blame] | 26 | class TargetInstrDesc; |
Evan Cheng | be85662 | 2008-03-13 00:44:09 +0000 | [diff] [blame] | 27 | class TargetInstrInfo; |
Dan Gohman | 1e57df3 | 2008-02-10 18:45:23 +0000 | [diff] [blame] | 28 | class TargetRegisterInfo; |
Dan Gohman | 221a437 | 2008-07-07 23:14:23 +0000 | [diff] [blame] | 29 | class MachineFunction; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 30 | |
| 31 | //===----------------------------------------------------------------------===// |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 32 | /// MachineInstr - Representation of each machine instruction. |
| 33 | /// |
| 34 | class MachineInstr { |
Chris Lattner | 5b93037 | 2008-01-07 07:27:27 +0000 | [diff] [blame] | 35 | const TargetInstrDesc *TID; // Instruction descriptor. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 36 | unsigned short NumImplicitOps; // Number of implicit operands (which |
| 37 | // are determined at construction time). |
| 38 | |
| 39 | std::vector<MachineOperand> Operands; // the operands |
Dan Gohman | 221a437 | 2008-07-07 23:14:23 +0000 | [diff] [blame] | 40 | alist<MachineMemOperand> MemOperands; // information on memory references |
Chris Lattner | 7ce487f | 2007-12-31 04:56:33 +0000 | [diff] [blame] | 41 | MachineBasicBlock *Parent; // Pointer to the owning basic block. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 42 | |
| 43 | // OperandComplete - Return true if it's illegal to add a new operand |
| 44 | bool OperandsComplete() const; |
| 45 | |
Dan Gohman | 221a437 | 2008-07-07 23:14:23 +0000 | [diff] [blame] | 46 | MachineInstr(const MachineInstr&); // DO NOT IMPLEMENT |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 47 | void operator=(const MachineInstr&); // DO NOT IMPLEMENT |
| 48 | |
| 49 | // Intrusive list support |
Dan Gohman | 221a437 | 2008-07-07 23:14:23 +0000 | [diff] [blame] | 50 | friend struct alist_traits<MachineInstr>; |
| 51 | friend struct alist_traits<MachineBasicBlock>; |
Chris Lattner | 7ce487f | 2007-12-31 04:56:33 +0000 | [diff] [blame] | 52 | void setParent(MachineBasicBlock *P) { Parent = P; } |
Dan Gohman | 221a437 | 2008-07-07 23:14:23 +0000 | [diff] [blame] | 53 | |
| 54 | /// MachineInstr ctor - This constructor creates a copy of the given |
| 55 | /// MachineInstr in the given MachineFunction. |
| 56 | MachineInstr(MachineFunction &, const MachineInstr &); |
| 57 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 58 | /// MachineInstr ctor - This constructor creates a dummy MachineInstr with |
| 59 | /// TID NULL and no operands. |
| 60 | MachineInstr(); |
| 61 | |
| 62 | /// MachineInstr ctor - This constructor create a MachineInstr and add the |
Chris Lattner | 720b6cf | 2007-12-30 00:12:25 +0000 | [diff] [blame] | 63 | /// implicit operands. It reserves space for number of operands specified by |
Chris Lattner | 5b93037 | 2008-01-07 07:27:27 +0000 | [diff] [blame] | 64 | /// TargetInstrDesc. |
| 65 | explicit MachineInstr(const TargetInstrDesc &TID, bool NoImp = false); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 66 | |
| 67 | /// MachineInstr ctor - Work exactly the same as the ctor above, except that |
| 68 | /// the MachineInstr is created and added to the end of the specified basic |
| 69 | /// block. |
| 70 | /// |
Chris Lattner | 5b93037 | 2008-01-07 07:27:27 +0000 | [diff] [blame] | 71 | MachineInstr(MachineBasicBlock *MBB, const TargetInstrDesc &TID); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 72 | |
| 73 | ~MachineInstr(); |
| 74 | |
Dan Gohman | 221a437 | 2008-07-07 23:14:23 +0000 | [diff] [blame] | 75 | // MachineInstrs are pool-allocated and owned by MachineFunction. |
| 76 | friend class MachineFunction; |
| 77 | |
| 78 | public: |
Chris Lattner | 7ce487f | 2007-12-31 04:56:33 +0000 | [diff] [blame] | 79 | const MachineBasicBlock* getParent() const { return Parent; } |
| 80 | MachineBasicBlock* getParent() { return Parent; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 81 | |
Chris Lattner | 6232760 | 2008-01-07 01:56:04 +0000 | [diff] [blame] | 82 | /// getDesc - Returns the target instruction descriptor of this |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 83 | /// MachineInstr. |
Chris Lattner | 5b93037 | 2008-01-07 07:27:27 +0000 | [diff] [blame] | 84 | const TargetInstrDesc &getDesc() const { return *TID; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 85 | |
| 86 | /// getOpcode - Returns the opcode of this MachineInstr. |
| 87 | /// |
Dan Gohman | 5f222be | 2007-09-14 20:08:19 +0000 | [diff] [blame] | 88 | int getOpcode() const; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 89 | |
| 90 | /// Access to explicit operands of the instruction. |
| 91 | /// |
Evan Cheng | 591bfc8 | 2008-05-05 18:30:58 +0000 | [diff] [blame] | 92 | unsigned getNumOperands() const { return (unsigned)Operands.size(); } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 93 | |
| 94 | const MachineOperand& getOperand(unsigned i) const { |
| 95 | assert(i < getNumOperands() && "getOperand() out of range!"); |
| 96 | return Operands[i]; |
| 97 | } |
| 98 | MachineOperand& getOperand(unsigned i) { |
| 99 | assert(i < getNumOperands() && "getOperand() out of range!"); |
| 100 | return Operands[i]; |
| 101 | } |
| 102 | |
| 103 | /// getNumExplicitOperands - Returns the number of non-implicit operands. |
| 104 | /// |
| 105 | unsigned getNumExplicitOperands() const; |
| 106 | |
Dan Gohman | 12a9c08 | 2008-02-06 22:27:42 +0000 | [diff] [blame] | 107 | /// Access to memory operands of the instruction |
Dan Gohman | 221a437 | 2008-07-07 23:14:23 +0000 | [diff] [blame] | 108 | alist<MachineMemOperand>::iterator memoperands_begin() |
| 109 | { return MemOperands.begin(); } |
| 110 | alist<MachineMemOperand>::iterator memoperands_end() |
| 111 | { return MemOperands.end(); } |
| 112 | alist<MachineMemOperand>::const_iterator memoperands_begin() const |
| 113 | { return MemOperands.begin(); } |
| 114 | alist<MachineMemOperand>::const_iterator memoperands_end() const |
| 115 | { return MemOperands.end(); } |
| 116 | bool memoperands_empty() const { return MemOperands.empty(); } |
Dan Gohman | 12a9c08 | 2008-02-06 22:27:42 +0000 | [diff] [blame] | 117 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 118 | /// isIdenticalTo - Return true if this instruction is identical to (same |
| 119 | /// opcode and same operands as) the specified instruction. |
| 120 | bool isIdenticalTo(const MachineInstr *Other) const { |
| 121 | if (Other->getOpcode() != getOpcode() || |
| 122 | Other->getNumOperands() != getNumOperands()) |
| 123 | return false; |
| 124 | for (unsigned i = 0, e = getNumOperands(); i != e; ++i) |
| 125 | if (!getOperand(i).isIdenticalTo(Other->getOperand(i))) |
| 126 | return false; |
| 127 | return true; |
| 128 | } |
| 129 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 130 | /// removeFromParent - This method unlinks 'this' from the containing basic |
| 131 | /// block, and returns it, but does not delete it. |
| 132 | MachineInstr *removeFromParent(); |
| 133 | |
| 134 | /// eraseFromParent - This method unlinks 'this' from the containing basic |
| 135 | /// block and deletes it. |
Dan Gohman | 221a437 | 2008-07-07 23:14:23 +0000 | [diff] [blame] | 136 | void eraseFromParent(); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 137 | |
Dan Gohman | fa607c9 | 2008-07-01 00:05:16 +0000 | [diff] [blame] | 138 | /// isLabel - Returns true if the MachineInstr represents a label. |
| 139 | /// |
| 140 | bool isLabel() const; |
| 141 | |
Evan Cheng | 13d1c29 | 2008-01-31 09:59:15 +0000 | [diff] [blame] | 142 | /// isDebugLabel - Returns true if the MachineInstr represents a debug label. |
| 143 | /// |
| 144 | bool isDebugLabel() const; |
| 145 | |
Evan Cheng | c7daf1f | 2008-03-05 00:59:57 +0000 | [diff] [blame] | 146 | /// readsRegister - Return true if the MachineInstr reads the specified |
| 147 | /// register. If TargetRegisterInfo is passed, then it also checks if there |
| 148 | /// is a read of a super-register. |
| 149 | bool readsRegister(unsigned Reg, const TargetRegisterInfo *TRI = NULL) const { |
| 150 | return findRegisterUseOperandIdx(Reg, false, TRI) != -1; |
| 151 | } |
| 152 | |
| 153 | /// killsRegister - Return true if the MachineInstr kills the specified |
| 154 | /// register. If TargetRegisterInfo is passed, then it also checks if there is |
| 155 | /// a kill of a super-register. |
| 156 | bool killsRegister(unsigned Reg, const TargetRegisterInfo *TRI = NULL) const { |
| 157 | return findRegisterUseOperandIdx(Reg, true, TRI) != -1; |
| 158 | } |
| 159 | |
| 160 | /// modifiesRegister - Return true if the MachineInstr modifies the |
| 161 | /// specified register. If TargetRegisterInfo is passed, then it also checks |
| 162 | /// if there is a def of a super-register. |
| 163 | bool modifiesRegister(unsigned Reg, |
| 164 | const TargetRegisterInfo *TRI = NULL) const { |
| 165 | return findRegisterDefOperandIdx(Reg, false, TRI) != -1; |
| 166 | } |
| 167 | |
| 168 | /// registerDefIsDead - Returns true if the register is dead in this machine |
| 169 | /// instruction. If TargetRegisterInfo is passed, then it also checks |
| 170 | /// if there is a dead def of a super-register. |
| 171 | bool registerDefIsDead(unsigned Reg, |
| 172 | const TargetRegisterInfo *TRI = NULL) const { |
| 173 | return findRegisterDefOperandIdx(Reg, true, TRI) != -1; |
| 174 | } |
| 175 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 176 | /// findRegisterUseOperandIdx() - Returns the operand index that is a use of |
| 177 | /// the specific register or -1 if it is not found. It further tightening |
| 178 | /// the search criteria to a use that kills the register if isKill is true. |
Evan Cheng | c7daf1f | 2008-03-05 00:59:57 +0000 | [diff] [blame] | 179 | int findRegisterUseOperandIdx(unsigned Reg, bool isKill = false, |
| 180 | const TargetRegisterInfo *TRI = NULL) const; |
| 181 | |
| 182 | /// findRegisterUseOperand - Wrapper for findRegisterUseOperandIdx, it returns |
| 183 | /// a pointer to the MachineOperand rather than an index. |
Evan Cheng | cae913c | 2008-03-29 01:04:05 +0000 | [diff] [blame] | 184 | MachineOperand *findRegisterUseOperand(unsigned Reg, bool isKill = false, |
Evan Cheng | c7daf1f | 2008-03-05 00:59:57 +0000 | [diff] [blame] | 185 | const TargetRegisterInfo *TRI = NULL) { |
| 186 | int Idx = findRegisterUseOperandIdx(Reg, isKill, TRI); |
| 187 | return (Idx == -1) ? NULL : &getOperand(Idx); |
| 188 | } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 189 | |
Evan Cheng | c7daf1f | 2008-03-05 00:59:57 +0000 | [diff] [blame] | 190 | /// findRegisterDefOperandIdx() - Returns the operand index that is a def of |
Dan Gohman | 2f51e1f | 2008-05-06 00:20:10 +0000 | [diff] [blame] | 191 | /// the specified register or -1 if it is not found. If isDead is true, defs |
| 192 | /// that are not dead are skipped. If TargetRegisterInfo is non-null, then it |
| 193 | /// also checks if there is a def of a super-register. |
Evan Cheng | c7daf1f | 2008-03-05 00:59:57 +0000 | [diff] [blame] | 194 | int findRegisterDefOperandIdx(unsigned Reg, bool isDead = false, |
| 195 | const TargetRegisterInfo *TRI = NULL) const; |
| 196 | |
| 197 | /// findRegisterDefOperand - Wrapper for findRegisterDefOperandIdx, it returns |
| 198 | /// a pointer to the MachineOperand rather than an index. |
| 199 | MachineOperand *findRegisterDefOperand(unsigned Reg,bool isDead = false, |
| 200 | const TargetRegisterInfo *TRI = NULL) { |
| 201 | int Idx = findRegisterDefOperandIdx(Reg, isDead, TRI); |
| 202 | return (Idx == -1) ? NULL : &getOperand(Idx); |
| 203 | } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 204 | |
| 205 | /// findFirstPredOperandIdx() - Find the index of the first operand in the |
| 206 | /// operand list that is used to represent the predicate. It returns -1 if |
| 207 | /// none is found. |
| 208 | int findFirstPredOperandIdx() const; |
| 209 | |
Evan Cheng | f1107fd | 2008-07-10 07:35:43 +0000 | [diff] [blame^] | 210 | /// isRegReDefinedByTwoAddr - Given the defined register and the operand index, |
| 211 | /// check if the register def is a re-definition due to two addr elimination. |
| 212 | bool isRegReDefinedByTwoAddr(unsigned Reg, unsigned DefIdx) const; |
Evan Cheng | 687d108 | 2007-10-12 08:50:34 +0000 | [diff] [blame] | 213 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 214 | /// copyKillDeadInfo - Copies kill / dead operand properties from MI. |
| 215 | /// |
| 216 | void copyKillDeadInfo(const MachineInstr *MI); |
| 217 | |
| 218 | /// copyPredicates - Copies predicate operand(s) from MI. |
| 219 | void copyPredicates(const MachineInstr *MI); |
| 220 | |
Owen Anderson | 5806079 | 2008-01-24 01:10:07 +0000 | [diff] [blame] | 221 | /// addRegisterKilled - We have determined MI kills a register. Look for the |
| 222 | /// operand that uses it and mark it as IsKill. If AddIfNotFound is true, |
| 223 | /// add a implicit operand if it's not found. Returns true if the operand |
| 224 | /// exists / is added. |
Dan Gohman | 1e57df3 | 2008-02-10 18:45:23 +0000 | [diff] [blame] | 225 | bool addRegisterKilled(unsigned IncomingReg, |
| 226 | const TargetRegisterInfo *RegInfo, |
Owen Anderson | 5806079 | 2008-01-24 01:10:07 +0000 | [diff] [blame] | 227 | bool AddIfNotFound = false); |
| 228 | |
| 229 | /// addRegisterDead - We have determined MI defined a register without a use. |
| 230 | /// Look for the operand that defines it and mark it as IsDead. If |
| 231 | /// AddIfNotFound is true, add a implicit operand if it's not found. Returns |
| 232 | /// true if the operand exists / is added. |
Dan Gohman | 1e57df3 | 2008-02-10 18:45:23 +0000 | [diff] [blame] | 233 | bool addRegisterDead(unsigned IncomingReg, const TargetRegisterInfo *RegInfo, |
Owen Anderson | 5806079 | 2008-01-24 01:10:07 +0000 | [diff] [blame] | 234 | bool AddIfNotFound = false); |
| 235 | |
Evan Cheng | e52c191 | 2008-07-03 09:09:37 +0000 | [diff] [blame] | 236 | /// isSafeToMove - Return true if it is safe to move this instruction. If |
| 237 | /// SawStore is set to true, it means that there is a store (or call) between |
| 238 | /// the instruction's location and its intended destination. |
Evan Cheng | be85662 | 2008-03-13 00:44:09 +0000 | [diff] [blame] | 239 | bool isSafeToMove(const TargetInstrInfo *TII, bool &SawStore); |
| 240 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 241 | // |
| 242 | // Debugging support |
| 243 | // |
| 244 | void print(std::ostream *OS, const TargetMachine *TM) const { |
| 245 | if (OS) print(*OS, TM); |
| 246 | } |
Chris Lattner | 9607bb8 | 2007-12-30 21:31:53 +0000 | [diff] [blame] | 247 | void print(std::ostream &OS, const TargetMachine *TM = 0) const; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 248 | void print(std::ostream *OS) const { if (OS) print(*OS); } |
| 249 | void dump() const; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 250 | |
| 251 | //===--------------------------------------------------------------------===// |
Chris Lattner | e45742f | 2008-01-01 01:12:31 +0000 | [diff] [blame] | 252 | // Accessors used to build up machine instructions. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 253 | |
Chris Lattner | e45742f | 2008-01-01 01:12:31 +0000 | [diff] [blame] | 254 | /// addOperand - Add the specified operand to the instruction. If it is an |
| 255 | /// implicit operand, it is added to the end of the operand list. If it is |
| 256 | /// an explicit operand it is added at the end of the explicit operand list |
| 257 | /// (before the first implicit operand). |
| 258 | void addOperand(const MachineOperand &Op); |
| 259 | |
Chris Lattner | 86bb02f | 2008-01-11 18:10:50 +0000 | [diff] [blame] | 260 | /// setDesc - Replace the instruction descriptor (thus opcode) of |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 261 | /// the current instruction with a new one. |
| 262 | /// |
Chris Lattner | 86bb02f | 2008-01-11 18:10:50 +0000 | [diff] [blame] | 263 | void setDesc(const TargetInstrDesc &tid) { TID = &tid; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 264 | |
| 265 | /// RemoveOperand - Erase an operand from an instruction, leaving it with one |
| 266 | /// fewer operand than it started with. |
| 267 | /// |
Chris Lattner | e45742f | 2008-01-01 01:12:31 +0000 | [diff] [blame] | 268 | void RemoveOperand(unsigned i); |
| 269 | |
Dan Gohman | 1fad9e6 | 2008-04-07 19:35:22 +0000 | [diff] [blame] | 270 | /// addMemOperand - Add a MachineMemOperand to the machine instruction, |
| 271 | /// referencing arbitrary storage. |
Dan Gohman | 221a437 | 2008-07-07 23:14:23 +0000 | [diff] [blame] | 272 | void addMemOperand(MachineFunction &MF, |
| 273 | const MachineMemOperand &MO); |
| 274 | |
| 275 | /// clearMemOperands - Erase all of this MachineInstr's MachineMemOperands. |
| 276 | void clearMemOperands(MachineFunction &MF); |
Dan Gohman | 12a9c08 | 2008-02-06 22:27:42 +0000 | [diff] [blame] | 277 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 278 | private: |
Chris Lattner | e45742f | 2008-01-01 01:12:31 +0000 | [diff] [blame] | 279 | /// getRegInfo - If this instruction is embedded into a MachineFunction, |
| 280 | /// return the MachineRegisterInfo object for the current function, otherwise |
| 281 | /// return null. |
| 282 | MachineRegisterInfo *getRegInfo(); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 283 | |
| 284 | /// addImplicitDefUseOperands - Add all implicit def and use operands to |
| 285 | /// this instruction. |
| 286 | void addImplicitDefUseOperands(); |
Chris Lattner | e45742f | 2008-01-01 01:12:31 +0000 | [diff] [blame] | 287 | |
| 288 | /// RemoveRegOperandsFromUseLists - Unlink all of the register operands in |
| 289 | /// this instruction from their respective use lists. This requires that the |
| 290 | /// operands already be on their use lists. |
| 291 | void RemoveRegOperandsFromUseLists(); |
| 292 | |
| 293 | /// AddRegOperandsToUseLists - Add all of the register operands in |
| 294 | /// this instruction from their respective use lists. This requires that the |
| 295 | /// operands not be on their use lists yet. |
| 296 | void AddRegOperandsToUseLists(MachineRegisterInfo &RegInfo); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 297 | }; |
| 298 | |
| 299 | //===----------------------------------------------------------------------===// |
| 300 | // Debugging Support |
| 301 | |
Chris Lattner | 9607bb8 | 2007-12-30 21:31:53 +0000 | [diff] [blame] | 302 | inline std::ostream& operator<<(std::ostream &OS, const MachineInstr &MI) { |
| 303 | MI.print(OS); |
| 304 | return OS; |
| 305 | } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 306 | |
| 307 | } // End llvm namespace |
| 308 | |
| 309 | #endif |