65 #define PASS_KEY "x86-flags-copy-lowering" 66 #define DEBUG_TYPE PASS_KEY 68 STATISTIC(NumCopiesEliminated,
"Number of copies of EFLAGS eliminated");
69 STATISTIC(NumSetCCsInserted,
"Number of setCC instructions inserted");
70 STATISTIC(NumTestsInserted,
"Number of test instructions inserted");
71 STATISTIC(NumAddsInserted,
"Number of adds instructions inserted");
76 using CondRegArray = std::array<unsigned, X86::LAST_VALID_COND + 1>;
82 StringRef getPassName()
const override {
return "X86 EFLAGS copy lowering"; }
103 std::pair<unsigned, bool>
113 CondRegArray &CondRegs);
117 CondRegArray &CondRegs);
121 CondRegArray &CondRegs);
134 CondRegArray &CondRegs);
140 "X86 EFLAGS copy lowering",
false,
false)
145 return new X86FlagsCopyLoweringPass();
150 void X86FlagsCopyLoweringPass::getAnalysisUsage(
AnalysisUsage &AU)
const {
175 "by this instruction!");
177 #define LLVM_EXPAND_INSTR_SIZES(MNEMONIC, SUFFIX) \ 178 case X86::MNEMONIC##8##SUFFIX: \ 179 case X86::MNEMONIC##16##SUFFIX: \ 180 case X86::MNEMONIC##32##SUFFIX: \ 181 case X86::MNEMONIC##64##SUFFIX: 183 #define LLVM_EXPAND_ADC_SBB_INSTR(MNEMONIC) \ 184 LLVM_EXPAND_INSTR_SIZES(MNEMONIC, rr) \ 185 LLVM_EXPAND_INSTR_SIZES(MNEMONIC, rr_REV) \ 186 LLVM_EXPAND_INSTR_SIZES(MNEMONIC, rm) \ 187 LLVM_EXPAND_INSTR_SIZES(MNEMONIC, mr) \ 188 case X86::MNEMONIC##8ri: \ 189 case X86::MNEMONIC##16ri8: \ 190 case X86::MNEMONIC##32ri8: \ 191 case X86::MNEMONIC##64ri8: \ 192 case X86::MNEMONIC##16ri: \ 193 case X86::MNEMONIC##32ri: \ 194 case X86::MNEMONIC##64ri32: \ 195 case X86::MNEMONIC##8mi: \ 196 case X86::MNEMONIC##16mi8: \ 197 case X86::MNEMONIC##32mi8: \ 198 case X86::MNEMONIC##64mi8: \ 199 case X86::MNEMONIC##16mi: \ 200 case X86::MNEMONIC##32mi: \ 201 case X86::MNEMONIC##64mi32: \ 202 case X86::MNEMONIC##8i8: \ 203 case X86::MNEMONIC##16i16: \ 204 case X86::MNEMONIC##32i32: \ 205 case X86::MNEMONIC##64i32: 213 #undef LLVM_EXPAND_ADC_SBB_INSTR 218 return FlagArithMnemonic::RCL;
223 return FlagArithMnemonic::RCR;
225 #undef LLVM_EXPAND_INSTR_SIZES 231 return FlagArithMnemonic::ADCX;
237 return FlagArithMnemonic::ADOX;
247 "Split instruction must be in the split block!");
249 "Only designed to split a tail of branch instructions!");
251 "Must split on an actual jCC instruction!");
257 "Must split after an actual jCC instruction!");
259 "Must only have this one terminator prior to the split!");
271 "Should only have spliced terminators!");
274 return MOp.isMBB() && MOp.getMBB() == &UnsplitSucc;
291 if (IsEdgeSplit || *
SI != &UnsplitSucc)
300 if (Succ != &UnsplitSucc)
305 "Failed to make the new block a successor!");
313 for (
int OpIdx = 1, NumOps =
MI.getNumOperands(); OpIdx < NumOps;
317 assert(OpMBB.
isMBB() &&
"Block operand to a PHI is not a block!");
318 if (OpMBB.
getMBB() != &MBB)
322 if (!IsEdgeSplit || Succ != &UnsplitSucc) {
331 MI.addOperand(MF, OpV);
344 case X86::CMOVBE_Fp32:
case X86::CMOVBE_Fp64:
case X86::CMOVBE_Fp80:
346 case X86::CMOVB_Fp32:
case X86::CMOVB_Fp64:
case X86::CMOVB_Fp80:
348 case X86::CMOVE_Fp32:
case X86::CMOVE_Fp64:
case X86::CMOVE_Fp80:
350 case X86::CMOVNBE_Fp32:
case X86::CMOVNBE_Fp64:
case X86::CMOVNBE_Fp80:
352 case X86::CMOVNB_Fp32:
case X86::CMOVNB_Fp64:
case X86::CMOVNB_Fp80:
354 case X86::CMOVNE_Fp32:
case X86::CMOVNE_Fp64:
case X86::CMOVNE_Fp80:
356 case X86::CMOVNP_Fp32:
case X86::CMOVNP_Fp64:
case X86::CMOVNP_Fp80:
358 case X86::CMOVP_Fp32:
case X86::CMOVP_Fp64:
case X86::CMOVP_Fp80:
363 bool X86FlagsCopyLoweringPass::runOnMachineFunction(
MachineFunction &MF) {
369 TII = Subtarget->getInstrInfo();
370 TRI = Subtarget->getRegisterInfo();
371 MDT = &getAnalysis<MachineDominatorTree>();
372 PromoteRC = &X86::GR8RegClass;
386 if (
MI.getOpcode() == TargetOpcode::COPY &&
387 MI.getOperand(0).getReg() == X86::EFLAGS)
395 "The input to the copy for EFLAGS should always be a register!");
397 if (CopyDefI.getOpcode() != TargetOpcode::COPY) {
413 dbgs() <<
"ERROR: Encountered unexpected def of an eflags copy: ";
416 "Cannot lower EFLAGS copy unless it is defined in turn by a copy!");
422 CopyI->eraseFromParent();
423 if (MRI->use_empty(CopyDefI.getOperand(0).getReg()))
424 CopyDefI.eraseFromParent();
425 ++NumCopiesEliminated;
429 assert(DOp.isDef() &&
"Expected register def!");
430 assert(DOp.getReg() == X86::EFLAGS &&
"Unexpected copy def register!");
435 auto TestPos = CopyDefI.getIterator();
436 DebugLoc TestLoc = CopyDefI.getDebugLoc();
463 assert(MDT->dominates(BeginMBB, EndMBB) &&
464 "Only support paths down the dominator tree!");
473 if (!Visited.insert(PredMBB).second)
475 if (HasEFLAGSClobber(PredMBB->begin(), PredMBB->end()))
480 }
while (!Worklist.
empty());
485 !HasEFLAGSClobber(TestMBB->
begin(), TestPos)) {
492 return MDT->findNearestCommonDominator(LHS, RHS);
498 if (HasEFLAGSClobberPath(HoistMBB, TestMBB))
516 return MI.findRegisterDefOperand(X86::EFLAGS);
519 dbgs() <<
" Using EFLAGS defined by: ";
522 dbgs() <<
" Using live-in flags for BB:\n";
537 CondRegArray CondRegs = collectCondsInRegs(*TestMBB, TestPos);
550 bool FlagsKilled =
false;
561 for (
auto MII = (&UseMBB == &MBB && !VisitedBlocks.
count(&UseMBB))
562 ? std::next(CopyI->getIterator())
571 if (&MI == CopyI || &MI == &CopyDefI) {
572 assert(&UseMBB == &MBB && VisitedBlocks.
count(&MBB) &&
573 "Should only encounter these on the second pass over the " 611 JmpIs.push_back(&*JmpIt);
621 rewriteCMov(*TestMBB, TestPos, TestLoc, MI, *FlagUse, CondRegs);
623 rewriteFCMov(*TestMBB, TestPos, TestLoc, MI, *FlagUse, CondRegs);
625 rewriteSetCC(*TestMBB, TestPos, TestLoc, MI, *FlagUse, CondRegs);
626 }
else if (MI.
getOpcode() == TargetOpcode::COPY) {
627 rewriteCopy(MI, *FlagUse, CopyDefI);
631 "Expected a def of EFLAGS for this instruction!");
648 rewriteSetCarryExtended(*TestMBB, TestPos, TestLoc, MI, *FlagUse,
654 rewriteArithmetic(*TestMBB, TestPos, TestLoc, MI, *FlagUse,
673 if (SuccMBB->isLiveIn(X86::EFLAGS) &&
674 VisitedBlocks.
insert(SuccMBB).second) {
688 if (SuccMBB == TestMBB || !MDT->dominates(TestMBB, SuccMBB)) {
691 <<
"ERROR: Encountered use that is not dominated by our test " 692 "basic block! Rewriting this would require inserting PHI " 693 "nodes to track the flag state across the CFG.\n\nTest " 696 dbgs() <<
"Use block:\n";
700 "Cannot lower EFLAGS copy when original copy def " 701 "does not dominate all uses.");
707 SuccMBB->removeLiveIn(X86::EFLAGS);
709 }
while (!Blocks.
empty());
718 if (JmpI->getParent() == LastJmpMBB)
723 rewriteCondJmp(*TestMBB, TestPos, TestLoc, *JmpI, CondRegs);
733 if (
MI.getOpcode() == TargetOpcode::COPY &&
734 (
MI.getOperand(0).getReg() == X86::EFLAGS ||
735 MI.getOperand(1).getReg() == X86::EFLAGS)) {
747 CondRegArray X86FlagsCopyLoweringPass::collectCondsInRegs(
749 CondRegArray CondRegs = {};
756 MI.getOperand(0).isReg() &&
759 "A non-storing SETcc should always define a register!");
760 CondRegs[Cond] =
MI.getOperand(0).getReg();
765 if (
MI.findRegisterDefOperand(X86::EFLAGS))
771 unsigned X86FlagsCopyLoweringPass::promoteCondToReg(
775 auto SetI =
BuildMI(TestMBB, TestPos, TestLoc,
776 TII->get(X86::SETCCr),
Reg).addImm(Cond);
783 std::pair<unsigned, bool> X86FlagsCopyLoweringPass::getCondOrInverseInReg(
786 unsigned &CondReg = CondRegs[Cond];
788 if (!CondReg && !InvCondReg)
789 CondReg = promoteCondToReg(TestMBB, TestPos, TestLoc, Cond);
792 return {CondReg,
false};
794 return {InvCondReg,
true};
807 void X86FlagsCopyLoweringPass::rewriteArithmetic(
810 CondRegArray &CondRegs) {
820 case FlagArithMnemonic::ADCX:
821 case FlagArithMnemonic::RCL:
822 case FlagArithMnemonic::RCR:
830 case FlagArithMnemonic::ADOX:
841 unsigned &CondReg = CondRegs[Cond];
843 CondReg = promoteCondToReg(TestMBB, TestPos, TestLoc, Cond);
848 Register TmpReg =
MRI->createVirtualRegister(PromoteRC);
865 CondRegArray &CondRegs) {
870 std::tie(CondReg, Inverted) =
871 getCondOrInverseInReg(TestMBB, TestPos, TestLoc, Cond, CondRegs);
891 CondRegArray &CondRegs) {
896 std::tie(CondReg, Inverted) =
897 getCondOrInverseInReg(TestMBB, TestPos, TestLoc, Cond, CondRegs);
904 auto getFCMOVOpcode = [](
unsigned Opcode,
bool Inverted) {
907 case X86::CMOVBE_Fp32:
case X86::CMOVNBE_Fp32:
908 case X86::CMOVB_Fp32:
case X86::CMOVNB_Fp32:
909 case X86::CMOVE_Fp32:
case X86::CMOVNE_Fp32:
910 case X86::CMOVP_Fp32:
case X86::CMOVNP_Fp32:
911 return Inverted ? X86::CMOVE_Fp32 : X86::CMOVNE_Fp32;
912 case X86::CMOVBE_Fp64:
case X86::CMOVNBE_Fp64:
913 case X86::CMOVB_Fp64:
case X86::CMOVNB_Fp64:
914 case X86::CMOVE_Fp64:
case X86::CMOVNE_Fp64:
915 case X86::CMOVP_Fp64:
case X86::CMOVNP_Fp64:
916 return Inverted ? X86::CMOVE_Fp64 : X86::CMOVNE_Fp64;
917 case X86::CMOVBE_Fp80:
case X86::CMOVNBE_Fp80:
918 case X86::CMOVB_Fp80:
case X86::CMOVNB_Fp80:
919 case X86::CMOVE_Fp80:
case X86::CMOVNE_Fp80:
920 case X86::CMOVP_Fp80:
case X86::CMOVNP_Fp80:
921 return Inverted ? X86::CMOVE_Fp80 : X86::CMOVNE_Fp80;
931 void X86FlagsCopyLoweringPass::rewriteCondJmp(
938 std::tie(CondReg, Inverted) =
939 getCondOrInverseInReg(TestMBB, TestPos, TestLoc, Cond, CondRegs);
953 void X86FlagsCopyLoweringPass::rewriteCopy(
MachineInstr &MI,
962 void X86FlagsCopyLoweringPass::rewriteSetCarryExtended(
965 CondRegArray &CondRegs) {
974 "Cannot have a non-register defined operand to this variant of SETB!");
979 auto RewriteToReg = [&](
unsigned Reg) {
991 auto AdjustReg = [&](
unsigned Reg) {
992 auto &OrigRC = *
MRI->getRegClass(Reg);
993 if (&OrigRC == &SetBRC)
998 int OrigRegSize =
TRI->getRegSizeInBits(OrigRC) / 8;
999 int TargetRegSize =
TRI->getRegSizeInBits(SetBRC) / 8;
1000 assert(OrigRegSize <= 8 &&
"No GPRs larger than 64-bits!");
1001 assert(TargetRegSize <= 8 &&
"No GPRs larger than 64-bits!");
1002 int SubRegIdx[] = {X86::NoSubRegister, X86::sub_8bit, X86::sub_16bit,
1003 X86::NoSubRegister, X86::sub_32bit};
1009 if (OrigRegSize < TargetRegSize && OrigRegSize < 4) {
1010 NewReg =
MRI->createVirtualRegister(&X86::GR32RegClass);
1011 BuildMI(MBB, SetPos, SetLoc,
TII->get(X86::MOVZX32rr8), NewReg)
1013 if (&SetBRC == &X86::GR32RegClass)
1019 NewReg =
MRI->createVirtualRegister(&SetBRC);
1020 if (OrigRegSize < TargetRegSize) {
1021 BuildMI(MBB, SetPos, SetLoc,
TII->get(TargetOpcode::SUBREG_TO_REG),
1025 .
addImm(SubRegIdx[OrigRegSize]);
1026 }
else if (OrigRegSize > TargetRegSize) {
1027 if (TargetRegSize == 1 && !Subtarget->is64Bit()) {
1029 MRI->constrainRegClass(Reg, &X86::GR32_ABCDRegClass);
1032 BuildMI(MBB, SetPos, SetLoc,
TII->get(TargetOpcode::COPY),
1034 .addReg(Reg, 0, SubRegIdx[TargetRegSize]);
1036 BuildMI(MBB, SetPos, SetLoc,
TII->get(TargetOpcode::COPY), NewReg)
1044 CondReg = promoteCondToReg(TestMBB, TestPos, TestLoc,
X86::COND_B);
1050 unsigned ExtCondReg = AdjustReg(CondReg);
1054 Register ZeroReg =
MRI->createVirtualRegister(&X86::GR32RegClass);
1055 BuildMI(MBB, SetPos, SetLoc,
TII->get(X86::MOV32r0), ZeroReg);
1056 ZeroReg = AdjustReg(ZeroReg);
1064 case X86::SETB_C16r:
1068 case X86::SETB_C32r:
1072 case X86::SETB_C64r:
1079 Register ResultReg =
MRI->createVirtualRegister(&SetBRC);
1080 BuildMI(MBB, SetPos, SetLoc,
TII->get(Sub), ResultReg)
1083 return RewriteToReg(ResultReg);
1091 CondRegArray &CondRegs) {
1096 unsigned &CondReg = CondRegs[Cond];
1098 CondReg = promoteCondToReg(TestMBB, TestPos, TestLoc, Cond);
1104 "Cannot have a non-register defined operand to SETcc!");
const MachineInstrBuilder & setMemRefs(ArrayRef< MachineMemOperand *> MMOs) const
const MachineInstrBuilder & add(const MachineOperand &MO) const
MachineOperand * findRegisterUseOperand(Register Reg, bool isKill=false, const TargetRegisterInfo *TRI=nullptr)
Wrapper for findRegisterUseOperandIdx, it returns a pointer to the MachineOperand rather than an inde...
instr_iterator instr_begin()
instr_iterator instr_end()
MachineBasicBlock * getMBB() const
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
void push_back(const T &Elt)
static void Cleanup(DenseMap< Instruction *, Instruction *> &NewPredicates, SetVector< Instruction *> &MaybeDead, Loop *L)
CondCode getCondFromCMov(const MachineInstr &MI)
Return condition code of a CMov opcode.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
AddrNumOperands - Total number of operands in a memory reference.
LLVM_NODISCARD detail::scope_exit< typename std::decay< Callable >::type > make_scope_exit(Callable &&F)
STATISTIC(NumFunctions, "Total number of functions")
unsigned const TargetRegisterInfo * TRI
iterator_range< succ_iterator > successors()
AnalysisUsage & addRequired()
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
unsigned getNumOperands() const
Return the number of declared MachineOperands for this MachineInstruction.
const HexagonInstrInfo * TII
MachineBasicBlock * getFallThrough()
Return the fallthrough block if the block can implicitly transfer control to the block after it by fa...
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
static X86::CondCode getCondFromFCMOV(unsigned Opcode)
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
bool isBranch(QueryType Type=AnyInBundle) const
Returns true if this is a conditional, unconditional, or indirect branch.
void normalizeSuccProbs()
Normalize probabilities of all successors so that the sum of them becomes one.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
FlagArithMnemonic
An enumeration of the arithmetic instruction mnemonics which have interesting flag semantics...
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
unsigned const MachineRegisterInfo * MRI
ArrayRef< MachineMemOperand * > memoperands() const
Access to memory operands of the instruction.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
void setMBB(MachineBasicBlock *MBB)
#define LLVM_EXPAND_ADC_SBB_INSTR(MNEMONIC)
Represent the analysis usage information of a pass.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly...
CondCode getCondFromSETCC(const MachineInstr &MI)
Return condition code of a SETCC opcode.
void setImm(int64_t immVal)
FunctionPass class - This class is used to implement most global optimizations.
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
self_iterator getIterator()
iterator_range< pred_iterator > predecessors()
auto find_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
static void r1(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D, uint32_t &E, int I, uint32_t *Buf)
succ_iterator succ_begin()
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
pred_iterator pred_begin()
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MachineOperand * findRegisterDefOperand(Register Reg, bool isDead=false, bool Overlap=false, const TargetRegisterInfo *TRI=nullptr)
Wrapper for findRegisterDefOperandIdx, it returns a pointer to the MachineOperand rather than an inde...
void setIsKill(bool Val=true)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
CondCode getCondFromBranch(const MachineInstr &MI)
Iterator for intrusive lists based on ilist_node.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
MachineOperand class - Representation of each machine instruction operand.
CondCode GetOppositeBranchCondition(CondCode CC)
GetOppositeBranchCondition - Return the inverse of the specified cond, e.g.
LLVM_NODISCARD T pop_back_val()
FunctionPass * createX86FlagsCopyLoweringPass()
Return a pass that lowers EFLAGS copy pseudo instructions.
INITIALIZE_PASS_BEGIN(X86FlagsCopyLoweringPass, DEBUG_TYPE, "X86 EFLAGS copy lowering", false, false) INITIALIZE_PASS_END(X86FlagsCopyLoweringPass
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool isLiveIn(MCPhysReg Reg, LaneBitmask LaneMask=LaneBitmask::getAll()) const
Return true if the specified register is in the live in set.
void replaceSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New)
Replace successor OLD with NEW and update probability info.
iterator insert(iterator I, T &&Elt)
void copySuccessor(MachineBasicBlock *Orig, succ_iterator I)
Copy a successor (and any probability info) from original block to this block's.
const MachineBasicBlock * getParent() const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
static MachineBasicBlock & splitBlock(MachineBasicBlock &MBB, MachineInstr &SplitI, const X86InstrInfo &TII)
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
#define LLVM_EXPAND_INSTR_SIZES(MNEMONIC, SUFFIX)
LLVM_NODISCARD bool empty() const
static FlagArithMnemonic getMnemonicFromOpcode(unsigned Opcode)
bool isSuccessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB is a successor of this block.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void insert(iterator MBBI, MachineBasicBlock *MBB)
static MachineOperand CreateMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0)
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
StringRef - Represent a constant reference to a string, i.e.
bool isMBB() const
isMBB - Tests if this is a MO_MachineBasicBlock operand.
Register getReg() const
getReg - Returns the register number.
const MachineOperand & getOperand(unsigned i) const
OutputIt copy(R &&Range, OutputIt Out)
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
Wrapper class representing virtual and physical registers.