20 #include "llvm/IR/IntrinsicsARM.h" 23 #define DEBUG_TYPE "arm-isel" 29 #define GET_GLOBALISEL_PREDICATE_BITSET 30 #include "ARMGenGlobalISel.inc" 31 #undef GET_GLOBALISEL_PREDICATE_BITSET 53 bool insertComparison(CmpConstants Helper, InsertInfo I,
unsigned ResReg,
55 unsigned PrevRes)
const;
58 void putConstant(InsertInfo I,
unsigned DestReg,
unsigned Constant)
const;
67 unsigned ExpectedSize,
unsigned ExpectedRegBankID)
const;
71 unsigned ExpectedRegBankID)
const;
122 unsigned ConstPoolLoad;
123 unsigned MOV_ga_pcrel;
124 unsigned LDRLIT_ga_pcrel;
125 unsigned LDRLIT_ga_abs;
134 unsigned selectSimpleExtOpc(
unsigned Opc,
unsigned Size)
const;
138 unsigned selectLoadStoreOpCode(
unsigned Opc,
unsigned RegBank,
139 unsigned Size)
const;
142 int OpIdx = -1)
const;
144 int OpIdx = -1)
const;
146 #define GET_GLOBALISEL_PREDICATES_DECL 147 #include "ARMGenGlobalISel.inc" 148 #undef GET_GLOBALISEL_PREDICATES_DECL 152 #define GET_GLOBALISEL_TEMPORARIES_DECL 153 #include "ARMGenGlobalISel.inc" 154 #undef GET_GLOBALISEL_TEMPORARIES_DECL 163 return new ARMInstructionSelector(TM, STI, RBI);
169 #define GET_GLOBALISEL_IMPL 170 #include "ARMGenGlobalISel.inc" 171 #undef GET_GLOBALISEL_IMPL 177 TRI(*STI.getRegisterInfo()), TM(TM), RBI(RBI), STI(STI), Opcodes(STI),
179 #include
"ARMGenGlobalISel.inc" 182 #include
"ARMGenGlobalISel.inc" 192 assert(RegBank &&
"Can't get reg bank for virtual register");
196 RegBank->
getID() == ARM::FPRRegBankID) &&
197 "Unsupported reg bank");
199 if (RegBank->
getID() == ARM::FPRRegBankID) {
201 return &ARM::SPRRegClass;
203 return &ARM::DPRRegClass;
204 else if (Size == 128)
205 return &ARM::QPRRegClass;
210 return &ARM::GPRRegClass;
217 if (Register::isPhysicalRegister(DstReg))
246 "Unsupported operand for G_MERGE_VALUES");
251 "Unsupported operand for G_MERGE_VALUES");
256 "Unsupported operand for G_MERGE_VALUES");
270 "Can't select unmerge without VFP");
278 "Unsupported operand for G_UNMERGE_VALUES");
283 "Unsupported operand for G_UNMERGE_VALUES");
288 "Unsupported operand for G_UNMERGE_VALUES");
296 ARMInstructionSelector::OpcodeCache::OpcodeCache(
const ARMSubtarget &STI) {
299 using namespace TargetOpcode;
301 #define STORE_OPCODE(VAR, OPC) VAR = isThumb ? ARM::t2##OPC : ARM::OPC 315 STORE16 = isThumb ? ARM::t2STRHi12 : ARM::STRH;
316 LOAD16 = isThumb ? ARM::t2LDRHi12 : ARM::LDRH;
334 ConstPoolLoad = isThumb ? ARM::t2LDRpci : ARM::LDRi12;
336 LDRLIT_ga_pcrel = isThumb ? ARM::tLDRLIT_ga_pcrel : ARM::LDRLIT_ga_pcrel;
337 LDRLIT_ga_abs = isThumb ? ARM::tLDRLIT_ga_abs : ARM::LDRLIT_ga_abs;
341 unsigned ARMInstructionSelector::selectSimpleExtOpc(
unsigned Opc,
342 unsigned Size)
const {
343 using namespace TargetOpcode;
345 if (Size != 8 && Size != 16)
349 return Size == 8 ? Opcodes.SEXT8 : Opcodes.SEXT16;
352 return Size == 8 ? Opcodes.ZEXT8 : Opcodes.ZEXT16;
357 unsigned ARMInstructionSelector::selectLoadStoreOpCode(
unsigned Opc,
359 unsigned Size)
const {
360 bool isStore = Opc == TargetOpcode::G_STORE;
362 if (RegBank == ARM::GPRRegBankID) {
366 return isStore ? Opcodes.STORE8 : Opcodes.LOAD8;
368 return isStore ? Opcodes.STORE16 : Opcodes.LOAD16;
370 return isStore ? Opcodes.STORE32 : Opcodes.LOAD32;
376 if (RegBank == ARM::FPRRegBankID) {
379 return isStore ? ARM::VSTRS : ARM::VLDRS;
381 return isStore ? ARM::VSTRD : ARM::VLDRD;
393 static std::pair<ARMCC::CondCodes, ARMCC::CondCodes>
397 case CmpInst::FCMP_ONE:
400 case CmpInst::FCMP_UEQ:
403 case CmpInst::ICMP_EQ:
404 case CmpInst::FCMP_OEQ:
407 case CmpInst::ICMP_SGT:
408 case CmpInst::FCMP_OGT:
411 case CmpInst::ICMP_SGE:
412 case CmpInst::FCMP_OGE:
415 case CmpInst::ICMP_UGT:
416 case CmpInst::FCMP_UGT:
419 case CmpInst::FCMP_OLT:
422 case CmpInst::ICMP_ULE:
423 case CmpInst::FCMP_OLE:
426 case CmpInst::FCMP_ORD:
429 case CmpInst::FCMP_UNO:
432 case CmpInst::FCMP_UGE:
435 case CmpInst::ICMP_SLT:
436 case CmpInst::FCMP_ULT:
439 case CmpInst::ICMP_SLE:
440 case CmpInst::FCMP_ULE:
443 case CmpInst::FCMP_UNE:
444 case CmpInst::ICMP_NE:
447 case CmpInst::ICMP_UGE:
450 case CmpInst::ICMP_ULT:
456 assert(Preds.first != ARMCC::AL &&
"No comparisons needed?");
461 CmpConstants(
unsigned CmpOpcode,
unsigned FlagsOpcode,
unsigned SelectOpcode,
462 unsigned OpRegBank,
unsigned OpSize)
463 : ComparisonOpcode(CmpOpcode), ReadFlagsOpcode(FlagsOpcode),
464 SelectResultOpcode(SelectOpcode), OperandRegBankID(OpRegBank),
465 OperandSize(OpSize) {}
486 : MBB(*MIB->
getParent()), InsertBefore(
std::next(MIB->getIterator())),
494 void ARMInstructionSelector::putConstant(
InsertInfo I,
unsigned DestReg,
504 unsigned LHSReg,
unsigned RHSReg,
505 unsigned ExpectedSize,
506 unsigned ExpectedRegBankID)
const {
508 validReg(MRI, LHSReg, ExpectedSize, ExpectedRegBankID) &&
509 validReg(MRI, RHSReg, ExpectedSize, ExpectedRegBankID);
513 unsigned ExpectedSize,
514 unsigned ExpectedRegBankID)
const {
528 bool ARMInstructionSelector::selectCmp(
CmpConstants Helper,
534 if (!validReg(MRI, ResReg, 1, ARM::GPRRegBankID))
539 if (Cond == CmpInst::FCMP_TRUE || Cond == CmpInst::FCMP_FALSE) {
540 putConstant(I, ResReg, Cond == CmpInst::FCMP_TRUE ? 1 : 0);
547 if (!validOpRegPair(MRI, LHSReg, RHSReg, Helper.
OperandSize,
553 putConstant(I, ZeroReg, 0);
557 if (!insertComparison(Helper, I, ResReg, ARMConds.first, LHSReg, RHSReg,
563 if (!insertComparison(Helper, I, IntermediateRes, ARMConds.first, LHSReg,
566 if (!insertComparison(Helper, I, ResReg, ARMConds.second, LHSReg, RHSReg,
578 unsigned LHSReg,
unsigned RHSReg,
579 unsigned PrevRes)
const {
619 if (GV->isThreadLocal()) {
629 unsigned Size =
TM.getPointerSize(0);
630 unsigned Alignment = 4;
632 auto addOpsForConstantPoolLoad = [&MF, Alignment,
635 assert((MIB->getOpcode() == ARM::LDRi12 ||
636 MIB->getOpcode() == ARM::t2LDRpci) &&
637 "Unsupported instruction");
638 auto ConstPool = MF.getConstantPool();
643 ? ConstPool->getConstantPoolIndex(
644 ARMConstantPoolConstant::Create(GV,
ARMCP::SBREL), Alignment)
645 : ConstPool->getConstantPoolIndex(GV, Alignment);
646 MIB.addConstantPoolIndex(CPIndex, 0, 0)
647 .addMemOperand(MF.getMachineMemOperand(
648 MachinePointerInfo::getConstantPool(MF), MachineMemOperand::MOLoad,
650 if (MIB->getOpcode() == ARM::LDRi12)
656 MIB.addMemOperand(MF.getMachineMemOperand(
657 MachinePointerInfo::getGOT(MF), MachineMemOperand::MOLoad,
658 TM.getProgramPointerSize(), Alignment));
661 if (
TM.isPositionIndependent()) {
669 bool UseOpcodeThatLoads = Indirect && !STI.
isThumb();
675 ? (UseOpcodeThatLoads ? (
unsigned)ARM::MOV_ga_pcrel_ldr
676 : Opcodes.MOV_ga_pcrel)
677 : (UseOpcodeThatLoads ? (
unsigned)ARM::LDRLIT_ga_pcrel_ldr
678 : Opcodes.LDRLIT_ga_pcrel);
679 MIB->setDesc(
TII.get(Opc));
686 MIB->getOperand(1).setTargetFlags(TargetFlags);
689 if (!UseOpcodeThatLoads) {
690 auto ResultReg = MIB->getOperand(0).getReg();
693 MIB->getOperand(0).setReg(AddressReg);
695 auto InsertBefore = std::next(MIB->getIterator());
696 auto MIBLoad =
BuildMI(MBB, InsertBefore, MIB->getDebugLoc(),
697 TII.get(Opcodes.LOAD32))
702 addGOTMemOperand(MIBLoad);
707 addGOTMemOperand(MIB);
715 if (STI.
isROPI() && isReadOnly) {
716 unsigned Opc = UseMovt ? Opcodes.MOV_ga_pcrel : Opcodes.LDRLIT_ga_pcrel;
717 MIB->setDesc(
TII.get(Opc));
720 if (STI.
isRWPI() && !isReadOnly) {
724 OffsetMIB =
BuildMI(MBB, *MIB, MIB->getDebugLoc(),
729 OffsetMIB =
BuildMI(MBB, *MIB, MIB->getDebugLoc(),
731 addOpsForConstantPoolLoad(OffsetMIB, GV,
true);
737 MIB->setDesc(
TII.get(Opcodes.ADDrr));
738 MIB->RemoveOperand(1);
749 MIB->setDesc(
TII.get(Opcodes.MOVi32imm));
752 MIB->setDesc(
TII.get(Opcodes.ConstPoolLoad));
753 MIB->RemoveOperand(1);
754 addOpsForConstantPoolLoad(MIB, GV,
false);
758 MIB->setDesc(
TII.get(Opcodes.MOVi32imm));
760 MIB->setDesc(
TII.get(Opcodes.LDRLIT_ga_abs));
777 assert(validReg(MRI, CondReg, 1, ARM::GPRRegBankID) &&
778 "Unsupported types for select operation");
779 auto CmpI =
BuildMI(MBB, InsertBefore, DbgLoc,
TII.get(Opcodes.TSTri))
791 assert(validOpRegPair(MRI, ResReg, TrueReg, 32, ARM::GPRRegBankID) &&
792 validOpRegPair(MRI, TrueReg, FalseReg, 32, ARM::GPRRegBankID) &&
793 "Unsupported types for select operation");
794 auto Mov1I =
BuildMI(MBB, InsertBefore, DbgLoc,
TII.get(Opcodes.MOVCCr))
806 bool ARMInstructionSelector::selectShift(
unsigned ShiftOpc,
815 void ARMInstructionSelector::renderVFPF32Imm(
819 OpIdx == -1 &&
"Expected G_FCONSTANT");
823 assert(FPImmEncoding != -1 &&
"Invalid immediate value");
825 NewInstBuilder.
addImm(FPImmEncoding);
828 void ARMInstructionSelector::renderVFPF64Imm(
831 OpIdx == -1 &&
"Expected G_FCONSTANT");
835 assert(FPImmEncoding != -1 &&
"Invalid immediate value");
837 NewInstBuilder.
addImm(FPImmEncoding);
846 auto &MRI = MF.getRegInfo();
855 using namespace TargetOpcode;
863 switch (I.getOpcode()) {
869 "Unsupported destination size for extension");
871 LLT SrcTy = MRI.
getType(I.getOperand(1).getReg());
876 I.setDesc(
TII.get(Opcodes.AND));
880 Register SExtResult = I.getOperand(0).getReg();
884 I.getOperand(0).setReg(AndResult);
886 auto InsertBefore = std::next(I.getIterator());
888 BuildMI(MBB, InsertBefore, I.getDebugLoc(),
TII.get(Opcodes.RSB))
901 unsigned NewOpc = selectSimpleExtOpc(I.getOpcode(), SrcSize);
902 if (NewOpc == I.getOpcode())
904 I.setDesc(
TII.get(NewOpc));
918 auto SrcReg = I.getOperand(1).getReg();
919 auto DstReg = I.getOperand(0).getReg();
921 const auto &SrcRegBank = *RBI.
getRegBank(SrcReg, MRI, TRI);
922 const auto &DstRegBank = *RBI.
getRegBank(DstReg, MRI, TRI);
924 if (SrcRegBank.getID() == ARM::FPRRegBankID) {
928 assert(I.getOpcode() == G_TRUNC &&
"Unsupported operand for G_ANYEXT");
929 assert(DstRegBank.getID() == ARM::GPRRegBankID &&
930 "Unsupported combination of register banks");
935 auto InsertBefore = std::next(I.getIterator());
949 if (SrcRegBank.getID() != DstRegBank.getID()) {
951 dbgs() <<
"G_TRUNC/G_ANYEXT operands on different register banks\n");
955 if (SrcRegBank.getID() != ARM::GPRRegBankID) {
956 LLVM_DEBUG(
dbgs() <<
"G_TRUNC/G_ANYEXT on non-GPR not supported yet\n");
960 I.setDesc(
TII.get(COPY));
970 auto &Val = I.getOperand(1);
972 if (!Val.getCImm()->isZero()) {
976 Val.ChangeToImmediate(0);
978 assert(Val.isImm() &&
"Unexpected operand for G_CONSTANT");
979 if (Val.getImm() != 0) {
986 I.setDesc(
TII.get(ARM::MOVi));
993 unsigned Alignment =
Size;
995 assert((Size == 4 || Size == 8) &&
"Unsupported FP constant type");
996 auto LoadOpcode = Size == 4 ? ARM::VLDRS : ARM::VLDRD;
998 auto ConstPool = MF.getConstantPool();
1000 ConstPool->getConstantPoolIndex(I.getOperand(1).getFPImm(), Alignment);
1005 MF.getMachineMemOperand(MachinePointerInfo::getConstantPool(MF),
1006 MachineMemOperand::MOLoad, Size, Alignment))
1013 auto SrcReg = I.getOperand(1).
getReg();
1014 auto DstReg = I.getOperand(0).getReg();
1016 const auto &SrcRegBank = *RBI.
getRegBank(SrcReg, MRI, TRI);
1017 const auto &DstRegBank = *RBI.
getRegBank(DstReg, MRI, TRI);
1019 if (SrcRegBank.getID() != DstRegBank.getID()) {
1022 <<
"G_INTTOPTR/G_PTRTOINT operands on different register banks\n");
1026 if (SrcRegBank.getID() != ARM::GPRRegBankID) {
1028 dbgs() <<
"G_INTTOPTR/G_PTRTOINT on non-GPR not supported yet\n");
1032 I.setDesc(
TII.get(COPY));
1036 return selectSelect(MIB, MRI);
1038 CmpConstants Helper(Opcodes.CMPrr, ARM::INSTRUCTION_LIST_END,
1039 Opcodes.MOVCCi, ARM::GPRRegBankID, 32);
1040 return selectCmp(Helper, MIB, MRI);
1045 Register OpReg = I.getOperand(2).getReg();
1048 if (Size == 64 && !STI.
hasFP64()) {
1049 LLVM_DEBUG(
dbgs() <<
"Subtarget only supports single precision");
1052 if (Size != 32 && Size != 64) {
1058 Opcodes.MOVCCi, ARM::FPRRegBankID, Size);
1059 return selectCmp(Helper, MIB, MRI);
1069 I.setDesc(
TII.get(Opcodes.ADDrr));
1075 I.setDesc(
TII.get(Opcodes.ADDri));
1078 case G_GLOBAL_VALUE:
1079 return selectGlobal(MIB, MRI);
1082 const auto &MemOp = **I.memoperands_begin();
1083 if (MemOp.isAtomic()) {
1088 Register Reg = I.getOperand(0).getReg();
1095 "Don't know how to load/store 64-bit value without VFP");
1097 const auto NewOpc = selectLoadStoreOpCode(I.getOpcode(), RegBank, ValSize);
1098 if (NewOpc == G_LOAD || NewOpc == G_STORE)
1101 if (ValSize == 1 && NewOpc == Opcodes.STORE8) {
1103 Register OriginalValue = I.getOperand(0).getReg();
1106 I.getOperand(0).setReg(ValueToStore);
1108 auto InsertBefore = I.getIterator();
1109 auto AndI =
BuildMI(MBB, InsertBefore, I.getDebugLoc(),
TII.get(Opcodes.AND))
1110 .addDef(ValueToStore)
1119 I.setDesc(
TII.get(NewOpc));
1121 if (NewOpc == ARM::LDRH || NewOpc == ARM::STRH)
1127 case G_MERGE_VALUES: {
1132 case G_UNMERGE_VALUES: {
1138 if (!validReg(MRI, I.getOperand(0).getReg(), 1, ARM::GPRRegBankID)) {
1139 LLVM_DEBUG(
dbgs() <<
"Unsupported condition register for G_BRCOND");
1145 BuildMI(*I.getParent(),
I, I.getDebugLoc(),
TII.get(Opcodes.TSTri))
1146 .addReg(I.getOperand(0).getReg())
1154 BuildMI(*I.getParent(),
I, I.getDebugLoc(),
TII.get(Opcodes.Bcc))
1155 .
add(I.getOperand(1))
1159 I.eraseFromParent();
1163 I.setDesc(
TII.get(PHI));
1165 Register DstReg = I.getOperand(0).getReg();
const MachineInstrBuilder & add(const MachineOperand &MO) const
InsertInfo(MachineInstrBuilder &MIB)
static bool selectMergeValues(MachineInstrBuilder &MIB, const ARMBaseInstrInfo &TII, MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI)
This class represents lattice values for constants.
Register getReg(unsigned Idx) const
Get the register for the operand index.
Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
unsigned getSizeInBits(Register Reg, const MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI) const
Get the size in bits of Reg.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
const ARMTargetLowering * getTargetLowering() const override
static uint64_t selectImpl(uint64_t CandidateMask, uint64_t &NextInSequenceMask)
LLT getType(unsigned Reg) const
Get the low-level type of Reg or LLT{} if Reg is not a generic (target independent) virtual register...
#define GET_GLOBALISEL_PREDICATES_INIT
unsigned const TargetRegisterInfo * TRI
InstructionSelector * createARMInstructionSelector(const ARMBaseTargetMachine &TM, const ARMSubtarget &STI, const ARMRegisterBankInfo &RBI)
static bool isThumb(const MCSubtargetInfo &STI)
LegalityPredicate isPointer(unsigned TypeIdx)
True iff the specified type index is a pointer (with any address space).
const unsigned ReadFlagsOpcode
Holds all the information related to register banks.
MO_SBREL - On a symbol operand, this represents a static base relative relocation.
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
const HexagonInstrInfo * TII
const ConstantFP * getFPImm() const
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
static StringRef getName(Value *V)
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const MachineInstrBuilder & addDef(Register RegNo, unsigned Flags=0, unsigned SubReg=0) const
Add a virtual register definition operand.
bool isGVIndirectSymbol(const GlobalValue *GV) const
True if the GV will be accessed via an indirect symbol.
const MachineInstrBuilder & addConstantPoolIndex(unsigned Idx, int Offset=0, unsigned TargetFlags=0) const
static std::array< MachineOperand, 2 > predOps(ARMCC::CondCodes Pred, unsigned PredReg=0)
Get the operands corresponding to the given Pred value.
MO_GOT - This flag indicates that a symbol operand represents the address of the GOT entry for the sy...
static bool isStore(int Opcode)
const MachineInstrBuilder & addGlobalAddress(const GlobalValue *GV, int64_t Offset=0, unsigned TargetFlags=0) const
This class provides the information for the target register banks.
bool isTargetDarwin() const
const ARMSubtarget & getSubtarget() const
bool isReadOnly(const GlobalValue *GV) const
static std::pair< ARMCC::CondCodes, ARMCC::CondCodes > getComparePreds(CmpInst::Predicate Pred)
TargetInstrInfo - Interface to description of machine instruction set.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
const MachineInstrBuilder & addUse(Register RegNo, unsigned Flags=0, unsigned SubReg=0) const
Add a virtual register use operand.
unsigned const MachineRegisterInfo * MRI
static int getFP32Imm(const APInt &Imm)
getFP32Imm - Return an 8-bit floating-point version of the 32-bit floating-point value.
This file declares the targeting of the RegisterBankInfo class for ARM.
This is an important base class in LLVM.
#define STORE_OPCODE(VAR, OPC)
const GlobalValue * getGlobal() const
bool isGVInGOT(const GlobalValue *GV) const
Returns the constant pool modifier needed to access the GV.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
static bool selectUnmergeValues(MachineInstrBuilder &MIB, const ARMBaseInstrInfo &TII, MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI)
const unsigned SelectResultOpcode
self_iterator getIterator()
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
StringRef getName(unsigned Opcode) const
Returns the name for the instructions with the given opcode.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static bool selectCopy(MachineInstr &I, const TargetInstrInfo &TII, MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI)
CmpConstants(unsigned CmpOpcode, unsigned FlagsOpcode, unsigned SelectOpcode, unsigned OpRegBank, unsigned OpSize)
const APFloat & getValueAPF() const
static int getFP64Imm(const APInt &Imm)
getFP64Imm - Return an 8-bit floating-point version of the 64-bit floating-point value.
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
static uint64_t add(uint64_t LeftOp, uint64_t RightOp)
RegisterBank & getRegBank(unsigned ID)
Get the register bank identified by ID.
unsigned getSizeInBits() const
Returns the total size of the type. Must only be called on sized types.
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
bool constrainSelectedInstRegOperands(MachineInstr &I, const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI)
Mutate the newly-selected instruction I to constrain its (possibly generic) virtual register operands...
This class implements the register bank concept.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
const unsigned OperandRegBankID
const MachineBasicBlock * getParent() const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Section Relative (Windows TLS)
Provides the logic to select generic machine instructions.
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
Bitwise operators - logical and, logical or, logical xor.
static MachineOperand condCodeOp(unsigned CCReg=0)
Get the operand corresponding to the conditional code result.
static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
Return the first found DebugLoc that has a DILocation, given a range of instructions.
#define GET_GLOBALISEL_TEMPORARIES_INIT
const unsigned ComparisonOpcode
const unsigned OperandSize
Instructions::iterator instr_iterator
bool isTargetMachO() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isPreISelGenericOpcode(unsigned Opcode)
Check whether the given Opcode is a generic opcode that is not supposed to appear after ISel...
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
static const Function * getParent(const Value *V)
MO_NONLAZY - This is an independent flag, on a symbol operand "FOO" it represents a symbol which...
const MachineBasicBlock::instr_iterator InsertBefore
void RemoveOperand(unsigned OpNo)
Erase an operand from an instruction, leaving it with one fewer operand than it started with...
Register getReg() const
getReg - Returns the register number.
const MachineOperand & getOperand(unsigned i) const
static const TargetRegisterClass * constrainGenericRegister(Register Reg, const TargetRegisterClass &RC, MachineRegisterInfo &MRI)
Constrain the (possibly generic) virtual register Reg to RC.
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Wrapper class representing virtual and physical registers.
unsigned getID() const
Get the identifier of this register bank.
unsigned getPredicate() const