LLVM  3.7.0
MachineInstrBuilder.h
Go to the documentation of this file.
1 //===-- CodeGen/MachineInstBuilder.h - Simplify creation of MIs -*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file exposes a function named BuildMI, which is useful for dramatically
11 // simplifying how MachineInstr's are created. It allows use of code like this:
12 //
13 // M = BuildMI(X86::ADDrr8, 2).addReg(argVal1).addReg(argVal2);
14 //
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_CODEGEN_MACHINEINSTRBUILDER_H
18 #define LLVM_CODEGEN_MACHINEINSTRBUILDER_H
19 
23 
24 namespace llvm {
25 
26 class MCInstrDesc;
27 class MDNode;
28 
29 namespace RegState {
30  enum {
31  Define = 0x2,
32  Implicit = 0x4,
33  Kill = 0x8,
34  Dead = 0x10,
35  Undef = 0x20,
36  EarlyClobber = 0x40,
37  Debug = 0x80,
38  InternalRead = 0x100,
42  };
43 }
44 
46  MachineFunction *MF;
47  MachineInstr *MI;
48 public:
49  MachineInstrBuilder() : MF(nullptr), MI(nullptr) {}
50 
51  /// Create a MachineInstrBuilder for manipulating an existing instruction.
52  /// F must be the machine function that was used to allocate I.
54 
55  /// Allow automatic conversion to the machine instruction we are working on.
56  ///
57  operator MachineInstr*() const { return MI; }
58  MachineInstr *operator->() const { return MI; }
59  operator MachineBasicBlock::iterator() const { return MI; }
60 
61  /// If conversion operators fail, use this method to get the MachineInstr
62  /// explicitly.
63  MachineInstr *getInstr() const { return MI; }
64 
65  /// addReg - Add a new virtual register operand...
66  ///
67  const
68  MachineInstrBuilder &addReg(unsigned RegNo, unsigned flags = 0,
69  unsigned SubReg = 0) const {
70  assert((flags & 0x1) == 0 &&
71  "Passing in 'true' to addReg is forbidden! Use enums instead.");
73  flags & RegState::Define,
74  flags & RegState::Implicit,
75  flags & RegState::Kill,
76  flags & RegState::Dead,
77  flags & RegState::Undef,
78  flags & RegState::EarlyClobber,
79  SubReg,
80  flags & RegState::Debug,
81  flags & RegState::InternalRead));
82  return *this;
83  }
84 
85  /// addImm - Add a new immediate operand.
86  ///
87  const MachineInstrBuilder &addImm(int64_t Val) const {
89  return *this;
90  }
91 
92  const MachineInstrBuilder &addCImm(const ConstantInt *Val) const {
94  return *this;
95  }
96 
97  const MachineInstrBuilder &addFPImm(const ConstantFP *Val) const {
99  return *this;
100  }
101 
103  unsigned char TargetFlags = 0) const {
104  MI->addOperand(*MF, MachineOperand::CreateMBB(MBB, TargetFlags));
105  return *this;
106  }
107 
108  const MachineInstrBuilder &addFrameIndex(int Idx) const {
109  MI->addOperand(*MF, MachineOperand::CreateFI(Idx));
110  return *this;
111  }
112 
114  int Offset = 0,
115  unsigned char TargetFlags = 0) const {
116  MI->addOperand(*MF, MachineOperand::CreateCPI(Idx, Offset, TargetFlags));
117  return *this;
118  }
119 
120  const MachineInstrBuilder &addTargetIndex(unsigned Idx, int64_t Offset = 0,
121  unsigned char TargetFlags = 0) const {
122  MI->addOperand(*MF, MachineOperand::CreateTargetIndex(Idx, Offset,
123  TargetFlags));
124  return *this;
125  }
126 
128  unsigned char TargetFlags = 0) const {
129  MI->addOperand(*MF, MachineOperand::CreateJTI(Idx, TargetFlags));
130  return *this;
131  }
132 
134  int64_t Offset = 0,
135  unsigned char TargetFlags = 0) const {
136  MI->addOperand(*MF, MachineOperand::CreateGA(GV, Offset, TargetFlags));
137  return *this;
138  }
139 
140  const MachineInstrBuilder &addExternalSymbol(const char *FnName,
141  unsigned char TargetFlags = 0) const {
142  MI->addOperand(*MF, MachineOperand::CreateES(FnName, TargetFlags));
143  return *this;
144  }
145 
147  int64_t Offset = 0,
148  unsigned char TargetFlags = 0) const {
149  MI->addOperand(*MF, MachineOperand::CreateBA(BA, Offset, TargetFlags));
150  return *this;
151  }
152 
153  const MachineInstrBuilder &addRegMask(const uint32_t *Mask) const {
155  return *this;
156  }
157 
159  MI->addMemOperand(*MF, MMO);
160  return *this;
161  }
162 
164  MachineInstr::mmo_iterator e) const {
165  MI->setMemRefs(b, e);
166  return *this;
167  }
168 
169 
171  MI->addOperand(*MF, MO);
172  return *this;
173  }
174 
175  const MachineInstrBuilder &addMetadata(const MDNode *MD) const {
177  assert((MI->isDebugValue() ? static_cast<bool>(MI->getDebugVariable())
178  : true) &&
179  "first MDNode argument of a DBG_VALUE not a variable");
180  return *this;
181  }
182 
183  const MachineInstrBuilder &addCFIIndex(unsigned CFIIndex) const {
184  MI->addOperand(*MF, MachineOperand::CreateCFIIndex(CFIIndex));
185  return *this;
186  }
187 
189  unsigned char TargetFlags = 0) const {
190  MI->addOperand(*MF, MachineOperand::CreateMCSymbol(Sym, TargetFlags));
191  return *this;
192  }
193 
194  const MachineInstrBuilder &setMIFlags(unsigned Flags) const {
195  MI->setFlags(Flags);
196  return *this;
197  }
198 
200  MI->setFlag(Flag);
201  return *this;
202  }
203 
204  // Add a displacement from an existing MachineOperand with an added offset.
205  const MachineInstrBuilder &addDisp(const MachineOperand &Disp, int64_t off,
206  unsigned char TargetFlags = 0) const {
207  switch (Disp.getType()) {
208  default:
209  llvm_unreachable("Unhandled operand type in addDisp()");
211  return addImm(Disp.getImm() + off);
213  // If caller specifies new TargetFlags then use it, otherwise the
214  // default behavior is to copy the target flags from the existing
215  // MachineOperand. This means if the caller wants to clear the
216  // target flags it needs to do so explicitly.
217  if (TargetFlags)
218  return addGlobalAddress(Disp.getGlobal(), Disp.getOffset() + off,
219  TargetFlags);
220  return addGlobalAddress(Disp.getGlobal(), Disp.getOffset() + off,
221  Disp.getTargetFlags());
222  }
223  }
224  }
225 
226  /// Copy all the implicit operands from OtherMI onto this one.
228  MI->copyImplicitOps(*MF, OtherMI);
229  return *this;
230  }
231 };
232 
233 /// BuildMI - Builder interface. Specify how to create the initial instruction
234 /// itself.
235 ///
237  DebugLoc DL,
238  const MCInstrDesc &MCID) {
239  return MachineInstrBuilder(MF, MF.CreateMachineInstr(MCID, DL));
240 }
241 
242 /// BuildMI - This version of the builder sets up the first operand as a
243 /// destination virtual register.
244 ///
246  DebugLoc DL,
247  const MCInstrDesc &MCID,
248  unsigned DestReg) {
249  return MachineInstrBuilder(MF, MF.CreateMachineInstr(MCID, DL))
250  .addReg(DestReg, RegState::Define);
251 }
252 
253 /// BuildMI - This version of the builder inserts the newly-built
254 /// instruction before the given position in the given MachineBasicBlock, and
255 /// sets up the first operand as a destination virtual register.
256 ///
259  DebugLoc DL,
260  const MCInstrDesc &MCID,
261  unsigned DestReg) {
262  MachineFunction &MF = *BB.getParent();
263  MachineInstr *MI = MF.CreateMachineInstr(MCID, DL);
264  BB.insert(I, MI);
265  return MachineInstrBuilder(MF, MI).addReg(DestReg, RegState::Define);
266 }
267 
270  DebugLoc DL,
271  const MCInstrDesc &MCID,
272  unsigned DestReg) {
273  MachineFunction &MF = *BB.getParent();
274  MachineInstr *MI = MF.CreateMachineInstr(MCID, DL);
275  BB.insert(I, MI);
276  return MachineInstrBuilder(MF, MI).addReg(DestReg, RegState::Define);
277 }
278 
280  MachineInstr *I,
281  DebugLoc DL,
282  const MCInstrDesc &MCID,
283  unsigned DestReg) {
284  if (I->isInsideBundle()) {
286  return BuildMI(BB, MII, DL, MCID, DestReg);
287  }
288 
290  return BuildMI(BB, MII, DL, MCID, DestReg);
291 }
292 
293 /// BuildMI - This version of the builder inserts the newly-built
294 /// instruction before the given position in the given MachineBasicBlock, and
295 /// does NOT take a destination register.
296 ///
299  DebugLoc DL,
300  const MCInstrDesc &MCID) {
301  MachineFunction &MF = *BB.getParent();
302  MachineInstr *MI = MF.CreateMachineInstr(MCID, DL);
303  BB.insert(I, MI);
304  return MachineInstrBuilder(MF, MI);
305 }
306 
309  DebugLoc DL,
310  const MCInstrDesc &MCID) {
311  MachineFunction &MF = *BB.getParent();
312  MachineInstr *MI = MF.CreateMachineInstr(MCID, DL);
313  BB.insert(I, MI);
314  return MachineInstrBuilder(MF, MI);
315 }
316 
318  MachineInstr *I,
319  DebugLoc DL,
320  const MCInstrDesc &MCID) {
321  if (I->isInsideBundle()) {
323  return BuildMI(BB, MII, DL, MCID);
324  }
325 
327  return BuildMI(BB, MII, DL, MCID);
328 }
329 
330 /// BuildMI - This version of the builder inserts the newly-built
331 /// instruction at the end of the given MachineBasicBlock, and does NOT take a
332 /// destination register.
333 ///
335  DebugLoc DL,
336  const MCInstrDesc &MCID) {
337  return BuildMI(*BB, BB->end(), DL, MCID);
338 }
339 
340 /// BuildMI - This version of the builder inserts the newly-built
341 /// instruction at the end of the given MachineBasicBlock, and sets up the first
342 /// operand as a destination virtual register.
343 ///
345  DebugLoc DL,
346  const MCInstrDesc &MCID,
347  unsigned DestReg) {
348  return BuildMI(*BB, BB->end(), DL, MCID, DestReg);
349 }
350 
351 /// BuildMI - This version of the builder builds a DBG_VALUE intrinsic
352 /// for either a value in a register or a register-indirect+offset
353 /// address. The convention is that a DBG_VALUE is indirect iff the
354 /// second operand is an immediate.
355 ///
357  const MCInstrDesc &MCID, bool IsIndirect,
358  unsigned Reg, unsigned Offset,
359  const MDNode *Variable, const MDNode *Expr) {
360  assert(isa<DILocalVariable>(Variable) && "not a variable");
361  assert(cast<DIExpression>(Expr)->isValid() && "not an expression");
362  assert(cast<DILocalVariable>(Variable)->isValidLocationForIntrinsic(DL) &&
363  "Expected inlined-at fields to agree");
364  if (IsIndirect)
365  return BuildMI(MF, DL, MCID)
366  .addReg(Reg, RegState::Debug)
367  .addImm(Offset)
368  .addMetadata(Variable)
369  .addMetadata(Expr);
370  else {
371  assert(Offset == 0 && "A direct address cannot have an offset.");
372  return BuildMI(MF, DL, MCID)
373  .addReg(Reg, RegState::Debug)
374  .addReg(0U, RegState::Debug)
375  .addMetadata(Variable)
376  .addMetadata(Expr);
377  }
378 }
379 
380 /// BuildMI - This version of the builder builds a DBG_VALUE intrinsic
381 /// for either a value in a register or a register-indirect+offset
382 /// address and inserts it at position I.
383 ///
386  const MCInstrDesc &MCID, bool IsIndirect,
387  unsigned Reg, unsigned Offset,
388  const MDNode *Variable, const MDNode *Expr) {
389  assert(isa<DILocalVariable>(Variable) && "not a variable");
390  assert(cast<DIExpression>(Expr)->isValid() && "not an expression");
391  MachineFunction &MF = *BB.getParent();
392  MachineInstr *MI =
393  BuildMI(MF, DL, MCID, IsIndirect, Reg, Offset, Variable, Expr);
394  BB.insert(I, MI);
395  return MachineInstrBuilder(MF, MI);
396 }
397 
398 
399 inline unsigned getDefRegState(bool B) {
400  return B ? RegState::Define : 0;
401 }
402 inline unsigned getImplRegState(bool B) {
403  return B ? RegState::Implicit : 0;
404 }
405 inline unsigned getKillRegState(bool B) {
406  return B ? RegState::Kill : 0;
407 }
408 inline unsigned getDeadRegState(bool B) {
409  return B ? RegState::Dead : 0;
410 }
411 inline unsigned getUndefRegState(bool B) {
412  return B ? RegState::Undef : 0;
413 }
414 inline unsigned getInternalReadRegState(bool B) {
415  return B ? RegState::InternalRead : 0;
416 }
417 inline unsigned getDebugRegState(bool B) {
418  return B ? RegState::Debug : 0;
419 }
420 
421 
422 /// Helper class for constructing bundles of MachineInstrs.
423 ///
424 /// MIBundleBuilder can create a bundle from scratch by inserting new
425 /// MachineInstrs one at a time, or it can create a bundle from a sequence of
426 /// existing MachineInstrs in a basic block.
428  MachineBasicBlock &MBB;
431 
432 public:
433  /// Create an MIBundleBuilder that inserts instructions into a new bundle in
434  /// BB above the bundle or instruction at Pos.
437  : MBB(BB), Begin(Pos.getInstrIterator()), End(Begin) {}
438 
439  /// Create a bundle from the sequence of instructions between B and E.
443  : MBB(BB), Begin(B.getInstrIterator()), End(E.getInstrIterator()) {
444  assert(B != E && "No instructions to bundle");
445  ++B;
446  while (B != E) {
447  MachineInstr *MI = B;
448  ++B;
449  MI->bundleWithPred();
450  }
451  }
452 
453  /// Create an MIBundleBuilder representing an existing instruction or bundle
454  /// that has MI as its head.
456  : MBB(*MI->getParent()), Begin(MI), End(getBundleEnd(MI)) {}
457 
458  /// Return a reference to the basic block containing this bundle.
459  MachineBasicBlock &getMBB() const { return MBB; }
460 
461  /// Return true if no instructions have been inserted in this bundle yet.
462  /// Empty bundles aren't representable in a MachineBasicBlock.
463  bool empty() const { return Begin == End; }
464 
465  /// Return an iterator to the first bundled instruction.
466  MachineBasicBlock::instr_iterator begin() const { return Begin; }
467 
468  /// Return an iterator beyond the last bundled instruction.
469  MachineBasicBlock::instr_iterator end() const { return End; }
470 
471  /// Insert MI into this bundle before I which must point to an instruction in
472  /// the bundle, or end().
474  MachineInstr *MI) {
475  MBB.insert(I, MI);
476  if (I == Begin) {
477  if (!empty())
478  MI->bundleWithSucc();
479  Begin = MI;
480  return *this;
481  }
482  if (I == End) {
483  MI->bundleWithPred();
484  return *this;
485  }
486  // MI was inserted in the middle of the bundle, so its neighbors' flags are
487  // already fine. Update MI's bundle flags manually.
490  return *this;
491  }
492 
493  /// Insert MI into MBB by prepending it to the instructions in the bundle.
494  /// MI will become the first instruction in the bundle.
496  return insert(begin(), MI);
497  }
498 
499  /// Insert MI into MBB by appending it to the instructions in the bundle.
500  /// MI will become the last instruction in the bundle.
502  return insert(end(), MI);
503  }
504 };
505 
506 } // End llvm namespace
507 
508 #endif
bool isInsideBundle() const
Return true if MI is in a bundle (but not the first MI in a bundle).
Definition: MachineInstr.h:205
MachineBasicBlock::instr_iterator begin() const
Return an iterator to the first bundled instruction.
void bundleWithPred()
Bundle this instruction with its predecessor.
const MachineInstrBuilder & addMetadata(const MDNode *MD) const
const MachineFunction * getParent() const
getParent - Return the MachineFunction containing this basic block.
MIBundleBuilder(MachineBasicBlock &BB, MachineBasicBlock::iterator Pos)
Create an MIBundleBuilder that inserts instructions into a new bundle in BB above the bundle or instr...
MachineInstr * CreateMachineInstr(const MCInstrDesc &MCID, DebugLoc DL, bool NoImp=false)
CreateMachineInstr - Allocate a new MachineInstr.
MachineBasicBlock::instr_iterator getBundleEnd(MachineInstr *MI)
Return an iterator pointing beyond the bundle containing MI.
const GlobalValue * getGlobal() const
static MachineOperand CreateCImm(const ConstantInt *CI)
static MachineOperand CreateMCSymbol(MCSymbol *Sym, unsigned char TargetFlags=0)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
static MachineOperand CreateJTI(unsigned Idx, unsigned char TargetFlags=0)
Describe properties that are true of each instruction in the target description file.
Definition: MCInstrDesc.h:138
MachineInstr * operator->() const
unsigned getInternalReadRegState(bool B)
A debug info location.
Definition: DebugLoc.h:34
Metadata node.
Definition: Metadata.h:740
F(f)
Instructions::iterator instr_iterator
const MachineInstrBuilder & addCFIIndex(unsigned CFIIndex) const
MIBundleBuilder(MachineBasicBlock &BB, MachineBasicBlock::iterator B, MachineBasicBlock::iterator E)
Create a bundle from the sequence of instructions between B and E.
BlockAddress - The address of a basic block.
Definition: Constants.h:802
MachineMemOperand - A description of a memory reference used in the backend.
MachineInstrBuilder(MachineFunction &F, MachineInstr *I)
Create a MachineInstrBuilder for manipulating an existing instruction.
static MachineOperand CreateReg(unsigned Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:98
const MachineInstrBuilder & addDisp(const MachineOperand &Disp, int64_t off, unsigned char TargetFlags=0) const
Reg
All possible values of the reg field in the ModR/M byte.
void bundleWithSucc()
Bundle this instruction with its successor.
static MachineOperand CreateRegMask(const uint32_t *Mask)
CreateRegMask - Creates a register mask operand referencing Mask.
const MachineInstrBuilder & addImm(int64_t Val) const
addImm - Add a new immediate operand.
MIBundleBuilder & prepend(MachineInstr *MI)
Insert MI into MBB by prepending it to the instructions in the bundle.
MachineBasicBlock & getMBB() const
Return a reference to the basic block containing this bundle.
int64_t getImm() const
void addMemOperand(MachineFunction &MF, MachineMemOperand *MO)
Add a MachineMemOperand to the machine instruction.
instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
unsigned getUndefRegState(bool B)
MachineBasicBlock::instr_iterator end() const
Return an iterator beyond the last bundled instruction.
unsigned getKillRegState(bool B)
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:97
unsigned getDebugRegState(bool B)
bool isDebugValue() const
Definition: MachineInstr.h:748
unsigned getDeadRegState(bool B)
unsigned getDefRegState(bool B)
bundle_iterator< MachineInstr, instr_iterator > iterator
Address of a global value.
unsigned getTargetFlags() const
const MachineInstrBuilder & setMemRefs(MachineInstr::mmo_iterator b, MachineInstr::mmo_iterator e) const
static MachineOperand CreateCPI(unsigned Idx, int Offset, unsigned char TargetFlags=0)
static MachineOperand CreateFPImm(const ConstantFP *CFP)
bundle_iterator - MachineBasicBlock iterator that automatically skips over MIs that are inside bundle...
ConstantFP - Floating Point Values [float, double].
Definition: Constants.h:233
bool empty() const
Return true if no instructions have been inserted in this bundle yet.
static MachineOperand CreateBA(const BlockAddress *BA, int64_t Offset, unsigned char TargetFlags=0)
void setFlag(MIFlag Flag)
Set a MI flag.
Definition: MachineInstr.h:155
const MachineInstrBuilder & addTargetIndex(unsigned Idx, int64_t Offset=0, unsigned char TargetFlags=0) const
const MachineInstrBuilder & setMIFlags(unsigned Flags) const
static MachineOperand CreateGA(const GlobalValue *GV, int64_t Offset, unsigned char TargetFlags=0)
static MachineOperand CreateTargetIndex(unsigned Idx, int64_t Offset, unsigned char TargetFlags=0)
int64_t getOffset() const
Return the offset from the symbol in this operand.
MachineInstrBuilder BuildMI(MachineFunction &MF, DebugLoc DL, const MCInstrDesc &MCID)
BuildMI - Builder interface.
const DILocalVariable * getDebugVariable() const
Return the debug variable referenced by this DBG_VALUE instruction.
Definition: MachineInstr.h:242
static MachineOperand CreateMetadata(const MDNode *Meta)
This is the shared class of boolean and integer constants.
Definition: Constants.h:47
void addOperand(MachineFunction &MF, const MachineOperand &Op)
Add the specified operand to the instruction.
void setFlags(unsigned flags)
Definition: MachineInstr.h:159
const MachineInstrBuilder & addJumpTableIndex(unsigned Idx, unsigned char TargetFlags=0) const
MachineOperand class - Representation of each machine instruction operand.
const MachineInstrBuilder & addCImm(const ConstantInt *Val) const
const MachineInstrBuilder & addFrameIndex(int Idx) const
MIBundleBuilder & insert(MachineBasicBlock::instr_iterator I, MachineInstr *MI)
Insert MI into this bundle before I which must point to an instruction in the bundle, or end().
const MachineInstrBuilder & addSym(MCSymbol *Sym, unsigned char TargetFlags=0) const
static MachineOperand CreateES(const char *SymName, unsigned char TargetFlags=0)
const MachineInstrBuilder & addGlobalAddress(const GlobalValue *GV, int64_t Offset=0, unsigned char TargetFlags=0) const
Representation of each machine instruction.
Definition: MachineInstr.h:51
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
void copyImplicitOps(MachineFunction &MF, const MachineInstr *MI)
Copy implicit register operands from specified instruction to this instruction.
static MachineOperand CreateMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0)
const MachineInstrBuilder & addExternalSymbol(const char *FnName, unsigned char TargetFlags=0) const
static MachineOperand CreateCFIIndex(unsigned CFIIndex)
const MachineInstrBuilder & addConstantPoolIndex(unsigned Idx, int Offset=0, unsigned char TargetFlags=0) const
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
static MachineOperand CreateImm(int64_t Val)
#define I(x, y, z)
Definition: MD5.cpp:54
unsigned getImplRegState(bool B)
const MachineInstrBuilder & copyImplicitOps(const MachineInstr *OtherMI)
Copy all the implicit operands from OtherMI onto this one.
const MachineInstrBuilder & addFPImm(const ConstantFP *Val) const
MIBundleBuilder & append(MachineInstr *MI)
Insert MI into MBB by appending it to the instructions in the bundle.
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
static const Function * getParent(const Value *V)
const MachineInstrBuilder & addOperand(const MachineOperand &MO) const
const MachineInstrBuilder & setMIFlag(MachineInstr::MIFlag Flag) const
const MachineInstrBuilder & addBlockAddress(const BlockAddress *BA, int64_t Offset=0, unsigned char TargetFlags=0) const
const MachineInstrBuilder & addRegMask(const uint32_t *Mask) const
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
addReg - Add a new virtual register operand...
static MachineOperand CreateFI(int Idx)
void setMemRefs(mmo_iterator NewMemRefs, mmo_iterator NewMemRefsEnd)
Assign this MachineInstr's memory reference descriptor list.
MIBundleBuilder(MachineInstr *MI)
Create an MIBundleBuilder representing an existing instruction or bundle that has MI as its head...
Helper class for constructing bundles of MachineInstrs.
MachineInstr * getInstr() const
If conversion operators fail, use this method to get the MachineInstr explicitly. ...