38 #define DEBUG_TYPE "mips-isel" 47 void MipsSEDAGToDAGISel::getAnalysisUsage(
AnalysisUsage &AU)
const {
52 void MipsSEDAGToDAGISel::addDSPCtrlRegOperands(
bool IsDef,
MachineInstr &
MI,
60 MIB.
addReg(Mips::DSPPos, Flag);
63 MIB.
addReg(Mips::DSPSCount, Flag);
66 MIB.
addReg(Mips::DSPCarry, Flag);
69 MIB.
addReg(Mips::DSPOutFlag, Flag);
72 MIB.
addReg(Mips::DSPCCond, Flag);
75 MIB.
addReg(Mips::DSPEFI, Flag);
78 unsigned MipsSEDAGToDAGISel::getMSACtrlReg(
const SDValue RegIdx)
const {
79 switch (cast<ConstantSDNode>(RegIdx)->getZExtValue()) {
82 case 0:
return Mips::MSAIR;
83 case 1:
return Mips::MSACSR;
84 case 2:
return Mips::MSAAccess;
85 case 3:
return Mips::MSASave;
86 case 4:
return Mips::MSAModify;
87 case 5:
return Mips::MSARequest;
88 case 6:
return Mips::MSAMap;
89 case 7:
return Mips::MSAUnmap;
95 unsigned DstReg = 0, ZeroReg = 0;
103 ZeroReg = Mips::ZERO;
104 }
else if ((MI.
getOpcode() == Mips::DADDiu) &&
109 ZeroReg = Mips::ZERO_64;
119 unsigned OpNo = U.getOperandNo();
152 RC = (ABI.
IsN64()) ? &Mips::GPR64RegClass : &Mips::GPR32RegClass;
167 BuildMI(MBB, I, DL, TII.
get(Mips::DADDu), V1).addReg(V0)
224 .addReg(Mips::V0).
addReg(Mips::T9);
227 void MipsSEDAGToDAGISel::processFunctionAfterISel(
MachineFunction &MF) {
228 initGlobalBaseReg(MF);
232 for (
auto &MBB: MF) {
233 for (
auto &MI: MBB) {
236 addDSPCtrlRegOperands(
false, MI, MF);
239 addDSPCtrlRegOperands(
true, MI, MF);
241 case Mips::BuildPairF64_64:
242 case Mips::ExtractElementF64_64:
254 replaceUsesWithZeroReg(MRI, MI);
260 void MipsSEDAGToDAGISel::selectAddE(
SDNode *Node,
const SDLoc &DL)
const {
269 SDValue Ops[3] = {LHS, RHS, InFlag};
310 SDValue InsOps[4] = {Zero, OuFlag, CstOne,
SDValue(DSPCFWithCarry, 0)};
314 SDValue(DSPCtrlFinal, 0), CstOne);
334 bool MipsSEDAGToDAGISel::selectAddrFrameIndexOffset(
336 unsigned ShiftAmount = 0)
const {
344 dyn_cast<FrameIndexSDNode>(Addr.
getOperand(0)))
364 bool MipsSEDAGToDAGISel::selectAddrRegImm(
SDValue Addr,
SDValue &Base,
367 if (selectAddrFrameIndex(Addr, Base, Offset))
384 if (selectAddrFrameIndexOffset(Addr, Base, Offset, 16))
400 if (isa<ConstantPoolSDNode>(Opnd0) || isa<GlobalAddressSDNode>(Opnd0) ||
401 isa<JumpTableSDNode>(Opnd0)) {
414 bool MipsSEDAGToDAGISel::selectAddrDefault(
SDValue Addr,
SDValue &Base,
421 bool MipsSEDAGToDAGISel::selectIntAddr(
SDValue Addr,
SDValue &Base,
423 return selectAddrRegImm(Addr, Base, Offset) ||
424 selectAddrDefault(Addr, Base, Offset);
427 bool MipsSEDAGToDAGISel::selectAddrRegImm9(
SDValue Addr,
SDValue &Base,
429 if (selectAddrFrameIndex(Addr, Base, Offset))
432 if (selectAddrFrameIndexOffset(Addr, Base, Offset, 9))
439 bool MipsSEDAGToDAGISel::selectAddrRegImm11(
SDValue Addr,
SDValue &Base,
441 if (selectAddrFrameIndex(Addr, Base, Offset))
444 if (selectAddrFrameIndexOffset(Addr, Base, Offset, 11))
451 bool MipsSEDAGToDAGISel::selectAddrRegImm12(
SDValue Addr,
SDValue &Base,
453 if (selectAddrFrameIndex(Addr, Base, Offset))
456 if (selectAddrFrameIndexOffset(Addr, Base, Offset, 12))
462 bool MipsSEDAGToDAGISel::selectAddrRegImm16(
SDValue Addr,
SDValue &Base,
464 if (selectAddrFrameIndex(Addr, Base, Offset))
467 if (selectAddrFrameIndexOffset(Addr, Base, Offset, 16))
473 bool MipsSEDAGToDAGISel::selectIntAddr11MM(
SDValue Addr,
SDValue &Base,
475 return selectAddrRegImm11(Addr, Base, Offset) ||
476 selectAddrDefault(Addr, Base, Offset);
479 bool MipsSEDAGToDAGISel::selectIntAddr12MM(
SDValue Addr,
SDValue &Base,
481 return selectAddrRegImm12(Addr, Base, Offset) ||
482 selectAddrDefault(Addr, Base, Offset);
485 bool MipsSEDAGToDAGISel::selectIntAddr16MM(
SDValue Addr,
SDValue &Base,
487 return selectAddrRegImm16(Addr, Base, Offset) ||
488 selectAddrDefault(Addr, Base, Offset);
491 bool MipsSEDAGToDAGISel::selectIntAddrLSL2MM(
SDValue Addr,
SDValue &Base,
493 if (selectAddrFrameIndexOffset(Addr, Base, Offset, 7)) {
494 if (isa<FrameIndexSDNode>(Base))
498 unsigned CnstOff = CN->getZExtValue();
499 return (CnstOff == (CnstOff & 0x3c));
507 if (selectAddrRegImm(Addr, Base, Offset))
510 return selectAddrDefault(Addr, Base, Offset);
513 bool MipsSEDAGToDAGISel::selectIntAddrSImm10(
SDValue Addr,
SDValue &Base,
516 if (selectAddrFrameIndex(Addr, Base, Offset))
519 if (selectAddrFrameIndexOffset(Addr, Base, Offset, 10))
522 return selectAddrDefault(Addr, Base, Offset);
525 bool MipsSEDAGToDAGISel::selectIntAddrSImm10Lsl1(
SDValue Addr,
SDValue &Base,
527 if (selectAddrFrameIndex(Addr, Base, Offset))
530 if (selectAddrFrameIndexOffset(Addr, Base, Offset, 10, 1))
533 return selectAddrDefault(Addr, Base, Offset);
536 bool MipsSEDAGToDAGISel::selectIntAddrSImm10Lsl2(
SDValue Addr,
SDValue &Base,
538 if (selectAddrFrameIndex(Addr, Base, Offset))
541 if (selectAddrFrameIndexOffset(Addr, Base, Offset, 10, 2))
544 return selectAddrDefault(Addr, Base, Offset);
547 bool MipsSEDAGToDAGISel::selectIntAddrSImm10Lsl3(
SDValue Addr,
SDValue &Base,
549 if (selectAddrFrameIndex(Addr, Base, Offset))
552 if (selectAddrFrameIndexOffset(Addr, Base, Offset, 10, 3))
555 return selectAddrDefault(Addr, Base, Offset);
563 bool MipsSEDAGToDAGISel::selectVSplat(
SDNode *
N,
APInt &Imm,
564 unsigned MinSizeInBits)
const {
573 APInt SplatValue, SplatUndef;
574 unsigned SplatBitSize;
577 if (!Node->
isConstantSplat(SplatValue, SplatUndef, SplatBitSize, HasAnyUndefs,
602 bool MipsSEDAGToDAGISel::
604 unsigned ImmBitSize)
const {
615 (!Signed && ImmValue.
isIntN(ImmBitSize))) {
625 bool MipsSEDAGToDAGISel::
627 return selectVSplatCommon(N, Imm,
false, 1);
630 bool MipsSEDAGToDAGISel::
632 return selectVSplatCommon(N, Imm,
false, 2);
635 bool MipsSEDAGToDAGISel::
637 return selectVSplatCommon(N, Imm,
false, 3);
641 bool MipsSEDAGToDAGISel::
643 return selectVSplatCommon(N, Imm,
false, 4);
647 bool MipsSEDAGToDAGISel::
649 return selectVSplatCommon(N, Imm,
false, 5);
653 bool MipsSEDAGToDAGISel::
655 return selectVSplatCommon(N, Imm,
false, 6);
659 bool MipsSEDAGToDAGISel::
661 return selectVSplatCommon(N, Imm,
false, 8);
665 bool MipsSEDAGToDAGISel::
667 return selectVSplatCommon(N, Imm,
true, 5);
680 bool MipsSEDAGToDAGISel::selectVSplatUimmPow2(
SDValue N,
SDValue &Imm)
const {
711 bool MipsSEDAGToDAGISel::selectVSplatMaskL(
SDValue N,
SDValue &Imm)
const {
723 if (ImmValue == ~(~ImmValue & ~(~ImmValue + 1))) {
745 bool MipsSEDAGToDAGISel::selectVSplatMaskR(
SDValue N,
SDValue &Imm)
const {
756 if (ImmValue == (ImmValue & ~(ImmValue + 1))) {
766 bool MipsSEDAGToDAGISel::selectVSplatUimmInvPow2(
SDValue N,
776 int32_t
Log2 = (~ImmValue).exactLogBase2();
787 bool MipsSEDAGToDAGISel::trySelect(
SDNode *Node) {
798 case Mips::PseudoD_SELECT_I:
799 case Mips::PseudoD_SELECT_I64: {
808 EVT NodeTys[] = {VT, VT};
810 ? Mips::PseudoD_SELECT_I64
811 : Mips::PseudoD_SELECT_I,
817 selectAddE(Node, DL);
856 AnalyzeImm.
Analyze(Imm, Size,
false);
867 if (Inst->Opc == Mips::LUi64)
876 for (++Inst; Inst != Seq.
end(); ++Inst) {
888 switch (cast<ConstantSDNode>(Node->
getOperand(1))->getZExtValue()) {
905 switch (cast<ConstantSDNode>(Node->
getOperand(0))->getZExtValue()) {
921 switch (cast<ConstantSDNode>(Node->
getOperand(1))->getZExtValue()) {
930 getMSACtrlReg(RegIdx), Value);
973 if (Pos + Size <= 32)
976 if (Pos + Size <= 32)
978 else if (Pos < 32 && 1 < Size)
979 Opcode = Mips::DINSM;
981 Opcode = Mips::DINSU;
998 unsigned RdhwrOpc, DestReg;
1001 RdhwrOpc = Mips::RDHWR;
1004 RdhwrOpc = Mips::RDHWR64;
1005 DestReg = Mips::V1_64;
1036 APInt SplatValue, SplatUndef;
1037 unsigned SplatBitSize;
1051 switch (SplatBitSize) {
1055 LdiOp = Mips::LDI_B;
1059 LdiOp = Mips::LDI_H;
1063 LdiOp = Mips::LDI_W;
1067 LdiOp = Mips::LDI_D;
1078 if (SplatValue.isSignedIntN(10)) {
1083 }
else if (SplatValue.isSignedIntN(16) &&
1084 ((ABI.
IsO32() && SplatBitSize < 64) ||
1091 bool Is32BitSplat = ABI.
IsO32() || SplatBitSize < 64;
1092 const unsigned ADDiuOp = Is32BitSplat ? Mips::ADDiu : Mips::DADDiu;
1095 Is32BitSplat ? Mips::ZERO : Mips::ZERO_64, SplatMVT);
1097 const unsigned FILLOp =
1100 : (SplatBitSize == 32 ? Mips::FILL_W
1101 : (SplatBitSize == 64 ? Mips::FILL_D : 0));
1103 assert(FILLOp != 0 &&
"Unknown FILL Op for splat synthesis!");
1104 assert((!ABI.
IsO32() || (FILLOp != Mips::FILL_D)) &&
1105 "Attempting to use fill.d on MIPS32!");
1107 const unsigned Lo = SplatValue.getLoBits(16).getZExtValue();
1113 }
else if (SplatValue.isSignedIntN(32) && SplatBitSize == 32) {
1116 const unsigned Lo = SplatValue.getLoBits(16).getZExtValue();
1117 const unsigned Hi = SplatValue.lshr(16).getLoBits(16).getZExtValue();
1128 Hi ?
SDValue(Res, 0) : ZeroVal, LoVal);
1130 assert((Hi || Lo) &&
"Zero case reached 32 bit case splat synthesis!");
1133 }
else if (SplatValue.isSignedIntN(32) && SplatBitSize == 64 &&
1138 const unsigned Lo = SplatValue.getLoBits(16).getZExtValue();
1139 const unsigned Hi = SplatValue.lshr(16).getLoBits(16).getZExtValue();
1150 Hi ?
SDValue(Res, 0) : ZeroVal, LoVal);
1161 }
else if (SplatValue.isSignedIntN(64)) {
1187 const unsigned Lo = SplatValue.getLoBits(16).getZExtValue();
1188 const unsigned Hi = SplatValue.lshr(16).getLoBits(16).getZExtValue();
1189 const unsigned Higher = SplatValue.lshr(32).getLoBits(16).getZExtValue();
1190 const unsigned Highest = SplatValue.lshr(48).getLoBits(16).getZExtValue();
1219 Hi ?
SDValue(Res, 0) : ZeroVal, LoVal);
1227 Highest ?
SDValue(HiRes, 0) : ZeroVal,
1233 (Hi || Lo) ?
SDValue(Res, 0) : ZeroVal);
1237 (Highest || Higher) ?
SDValue(HiRes, 0) : ZeroVal,
1245 Mips::COPY_TO_REGCLASS, DL, ViaVecTy,
SDValue(Res, 0),
1254 const bool HiResNonZero = Highest ||
Higher;
1255 const bool ResNonZero = Hi ||
Lo;
1288 }
else if (HiResNonZero) {
1294 "Zero splat value handled by non-zero 64bit splat synthesis!");
1303 if (ResVecTy != ViaVecTy) {
1326 bool MipsSEDAGToDAGISel::
1327 SelectInlineAsmMemoryOperand(
const SDValue &
Op,
unsigned ConstraintID,
1328 std::vector<SDValue> &OutOps) {
1331 switch(ConstraintID) {
1336 OutOps.push_back(Op);
1340 if (selectAddrRegImm16(Op, Base, Offset)) {
1341 OutOps.push_back(Base);
1342 OutOps.push_back(Offset);
1345 OutOps.push_back(Op);
1354 if (selectAddrRegImm9(Op, Base, Offset)) {
1355 OutOps.push_back(Base);
1356 OutOps.push_back(Offset);
1359 OutOps.push_back(Op);
1367 if (selectAddrRegImm12(Op, Base, Offset)) {
1368 OutOps.push_back(Base);
1369 OutOps.push_back(Offset);
1374 if (selectAddrRegImm9(Op, Base, Offset)) {
1375 OutOps.push_back(Base);
1376 OutOps.push_back(Offset);
1379 }
else if (selectAddrRegImm16(Op, Base, Offset)) {
1381 OutOps.push_back(Base);
1382 OutOps.push_back(Offset);
1386 OutOps.push_back(Op);
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
SDNode * SelectNodeTo(SDNode *N, unsigned MachineOpc, EVT VT)
These are used for target selectors to mutate the specified node to have the specified return type...
EVT getValueType() const
Return the ValueType of the referenced return value.
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
typename SuperClass::const_iterator const_iterator
const TargetRegisterClass * getRegClass(unsigned Reg) const
Return the register class of the specified virtual register.
bool isConstantSplat(APInt &SplatValue, APInt &SplatUndef, unsigned &SplatBitSize, bool &HasAnyUndefs, unsigned MinSplatBits=0, bool isBigEndian=false) const
Check if this is a constant splat, and if so, find the smallest element size that splats the vector...
This class represents lattice values for constants.
FunctionPass * createMipsSEISelDag(MipsTargetMachine &TM, CodeGenOpt::Level OptLevel)
bool inMips16Mode() const
void addLiveIn(unsigned Reg, unsigned vreg=0)
addLiveIn - Add the specified register as a live-in.
Carry-setting nodes for multiple precision addition and subtraction.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
unsigned getReg() const
getReg - Returns the register number.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
const MipsInstrInfo * getInstrInfo() const override
TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or anything else with this node...
unsigned getValueSizeInBits(unsigned ResNo) const
Returns MVT::getSizeInBits(getValueType(ResNo)).
virtual const TargetRegisterClass * getRegClassFor(MVT VT) const
Return the register class that should be used for the specified value type.
MVT getSimpleValueType(unsigned ResNo) const
Return the type of a specified result as a simple type.
SDNode * getNode() const
get the SDNode which holds the desired result
const MachineInstrBuilder & addGlobalAddress(const GlobalValue *GV, int64_t Offset=0, unsigned char TargetFlags=0) const
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
unsigned getBitWidth() const
Return the number of bits in the APInt.
return AArch64::GPR64RegClass contains(Reg)
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, bool isRenamable=false)
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
GlobalBaseReg - On Darwin, this node represents the result of the mflr at function entry...
AnalysisUsage & addRequired()
static use_iterator use_end()
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
bool globalBaseRegSet() const
bool inMicroMipsMode() const
MachineSDNode * getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT)
These are used for target selectors to create a new node with specified return type(s), MachineInstr opcode, and operands.
const TargetLowering * TLI
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
const DataLayout & getDataLayout() const
unsigned getID() const
Return the register class ID number.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
MO_ABS_HI/LO - Represents the hi or low part of an absolute symbol address.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
int64_t getSExtValue() const
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
SDValue getTargetFrameIndex(int FI, EVT VT)
Simple integer binary arithmetic operators.
int32_t exactLogBase2() const
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
Flag
These should be considered private to the implementation of the MCInstrDesc class.
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
TargetInstrInfo - Interface to description of machine instruction set.
MachineRegisterInfo * RegInfo
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
CodeGenOpt::Level OptLevel
void addLiveIn(MCPhysReg PhysReg, LaneBitmask LaneMask=LaneBitmask::getAll())
Adds the specified register as a live in.
unsigned const MachineRegisterInfo * MRI
MVT getPointerTy(const DataLayout &DL, uint32_t AS=0) const
Return the pointer type for the given address space, defaults to the pointer type from the data layou...
unsigned countPopulation() const
Count the number of bits set.
const MipsSubtarget * Subtarget
Keep a pointer to the MipsSubtarget around so that we can make the right decision when generating cod...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool isPseudo(QueryType Type=IgnoreBundle) const
Return true if this is a pseudo instruction that doesn't correspond to a real machine instruction...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
const SDValue & getOperand(unsigned Num) const
Carry-using nodes for multiple precision addition and subtraction.
Represent the analysis usage information of a pass.
bool isExactlyValue(double V) const
We don't rely on operator== working on double values, as it returns true for things that are clearly ...
bool isBaseWithConstantOffset(SDValue Op) const
Return true if the specified operand is an ISD::ADD with a ConstantSDNode on the right-hand side...
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
FunctionPass class - This class is used to implement most global optimizations.
bool isRegTiedToDefOperand(unsigned UseOpIdx, unsigned *DefOpIdx=nullptr) const
Return true if the use operand of the specified index is tied to a def operand.
Class to represent integer types.
bool isIntN(unsigned N) const
Check if this APInt has an N-bits unsigned integer value.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
bool isIntN(unsigned N, int64_t x)
Checks if an signed integer fits into the given (dynamic) bit width.
const MachineBasicBlock & front() const
unsigned getNumOperands() const
Return the number of values used by this operation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
This is the shared class of boolean and integer constants.
constexpr bool isInt< 32 >(int64_t x)
void addOperand(MachineFunction &MF, const MachineOperand &Op)
Add the specified operand to the instruction.
unsigned getGlobalBaseReg()
EVT getVectorElementType() const
Given a vector type, return the type of each element.
double Log2(double Value)
Return the log base 2 of the specified value.
MachineOperand class - Representation of each machine instruction operand.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
Represents one node in the SelectionDAG.
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
const Function & getFunction() const
Return the LLVM function that this machine code represents.
Class for arbitrary precision integers.
A "pseudo-class" with methods for operating on BUILD_VECTORs.
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.
This file provides various utilities for inspecting and working with the control flow graph in LLVM I...
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
use_iterator use_begin(unsigned RegNo) const
bool is128BitVector() const
Return true if this is a 128-bit vector type.
bool isPositionIndependent() const
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
const MachineInstrBuilder & addExternalSymbol(const char *FnName, unsigned char TargetFlags=0) const
void setReg(unsigned Reg)
Change the register this operand corresponds to.
MipsFunctionInfo - This class is derived from MachineFunction private Mips target-specific informatio...
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
MipsSEDAGToDAGISel(MipsTargetMachine &TM, CodeGenOpt::Level OL)
unsigned getOpcode() const
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
bool isSignedIntN(unsigned N) const
Check if this APInt has an N-bits signed integer value.
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
const TargetLowering * getTargetLowering() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
SDValue getRegister(unsigned Reg, EVT VT)
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
uint64_t OffsetToAlignment(uint64_t Value, uint64_t Align)
Returns the offset to the next integer (mod 2**64) that is greater than or equal to Value and is a mu...
void ReplaceNode(SDNode *F, SDNode *T)
Replace all uses of F with T, then remove F from the DAG.
Legacy analysis pass which computes a DominatorTree.
const SDValue & getOperand(unsigned i) const
uint64_t getZExtValue() const
const MachineOperand & getOperand(unsigned i) const
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
const TargetInstrInfo * TII
reg_begin/reg_end - Provide iteration support to walk over all definitions and uses of a register wit...
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
unsigned createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...