27#include "llvm/IR/IntrinsicsMips.h"
33#define DEBUG_TYPE "mips-isel"
46void MipsSEDAGToDAGISel::addDSPCtrlRegOperands(
bool IsDef,
MachineInstr &
MI,
49 unsigned Mask =
MI.getOperand(1).getImm();
54 MIB.addReg(Mips::DSPPos, Flag);
57 MIB.addReg(Mips::DSPSCount, Flag);
60 MIB.addReg(Mips::DSPCarry, Flag);
63 MIB.addReg(Mips::DSPOutFlag, Flag);
66 MIB.addReg(Mips::DSPCCond, Flag);
69 MIB.addReg(Mips::DSPEFI, Flag);
74 return Mips::MSACtrlRegClass.getRegister(RegNum);
79 unsigned DstReg = 0, ZeroReg = 0;
82 if ((
MI.getOpcode() == Mips::ADDiu) &&
83 (
MI.getOperand(1).getReg() == Mips::ZERO) &&
84 (
MI.getOperand(2).isImm()) &&
85 (
MI.getOperand(2).getImm() == 0)) {
86 DstReg =
MI.getOperand(0).getReg();
88 }
else if ((
MI.getOpcode() == Mips::DADDiu) &&
89 (
MI.getOperand(1).getReg() == Mips::ZERO_64) &&
90 (
MI.getOperand(2).isImm()) &&
91 (
MI.getOperand(2).getImm() == 0)) {
92 DstReg =
MI.getOperand(0).getReg();
93 ZeroReg = Mips::ZERO_64;
102 MachineOperand &MO = *
U;
103 unsigned OpNo =
U.getOperandNo();
108 if (
MI->isPHI() ||
MI->isRegTiedToDefOperand(OpNo) ||
MI->isPseudo())
124 MachineInstrBuilder MIB(
MF, &
MI);
149void MipsSEDAGToDAGISel::processFunctionAfterISel(
MachineFunction &MF) {
152 MachineRegisterInfo *MRI = &
MF.getRegInfo();
154 for (
auto &
MBB:
MF) {
155 for (
auto &
MI:
MBB) {
156 switch (
MI.getOpcode()) {
158 addDSPCtrlRegOperands(
false,
MI,
MF);
161 addDSPCtrlRegOperands(
true,
MI,
MF);
163 case Mips::BuildPairF64_64:
164 case Mips::ExtractElementF64_64:
170 case Mips::BuildPairF64:
171 case Mips::ExtractElementF64:
177 if (
MI.getOperand(0).isGlobal() &&
178 MI.getOperand(0).getGlobal()->hasExternalLinkage() &&
179 MI.getOperand(0).getGlobal()->getName() ==
"_mcount")
182 case Mips::JALRPseudo:
183 case Mips::JALR64Pseudo:
184 case Mips::JALR16_MM:
185 if (
MI.getOperand(2).isMCSymbol() &&
186 MI.getOperand(2).getMCSymbol()->getName() ==
"_mcount")
190 if (
MI.getOperand(3).isMCSymbol() &&
191 MI.getOperand(3).getMCSymbol()->getName() ==
"_mcount")
195 replaceUsesWithZeroReg(MRI,
MI);
201void MipsSEDAGToDAGISel::selectAddE(
SDNode *Node,
const SDLoc &
DL)
const {
205 EVT VT =
LHS.getValueType();
211 CurDAG->SelectNodeTo(Node, Mips::ADDWC, VT, MVT::Glue,
Ops);
233 SDNode *DSPCtrlField =
CurDAG->getMachineNode(Mips::RDDSP,
DL, MVT::i32,
234 MVT::Glue, CstOne, InGlue);
236 SDNode *Carry =
CurDAG->getMachineNode(
237 Mips::EXT,
DL, MVT::i32,
SDValue(DSPCtrlField, 0), OuFlag, CstOne);
240 CurDAG->getTargetConstant(6,
DL, MVT::i32), CstOne,
242 SDNode *DSPCFWithCarry =
CurDAG->getMachineNode(Mips::INS,
DL, MVT::i32,
Ops);
252 SDNode *DSPCtrlFinal =
253 CurDAG->getMachineNode(Mips::INS,
DL, MVT::i32, InsOps);
255 SDNode *WrDSP =
CurDAG->getMachineNode(Mips::WRDSP,
DL, MVT::Glue,
256 SDValue(DSPCtrlFinal, 0), CstOne);
259 CurDAG->SelectNodeTo(Node, Mips::ADDWC, VT, MVT::Glue, Operands);
268 Base =
CurDAG->getTargetFrameIndex(FIN->getIndex(), ValTy);
269 Offset =
CurDAG->getTargetConstant(0, SDLoc(Addr), ValTy);
276bool MipsSEDAGToDAGISel::selectAddrFrameIndexOffset(
278 unsigned ShiftAmount = 0)
const {
279 if (
CurDAG->isBaseWithConstantOffset(Addr)) {
281 if (
isIntN(OffsetBits + ShiftAmount, CN->getSExtValue())) {
285 if (FrameIndexSDNode *FIN =
287 Base =
CurDAG->getTargetFrameIndex(FIN->getIndex(), ValTy);
292 const Align Alignment(1ULL << ShiftAmount);
293 if (!
isAligned(Alignment, CN->getZExtValue()))
297 Offset =
CurDAG->getTargetConstant(CN->getZExtValue(), SDLoc(Addr),
314 if (Addr.
getOpcode() == MipsISD::Wrapper) {
320 if (!
TM.isPositionIndependent()) {
327 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 16))
366 return selectAddrRegImm(Addr,
Base,
Offset) ||
375 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 9))
387 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 11))
399 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 12))
410 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 16))
418 return selectAddrRegImm11(Addr,
Base,
Offset) ||
424 return selectAddrRegImm12(Addr,
Base,
Offset) ||
430 return selectAddrRegImm16(Addr,
Base,
Offset) ||
436 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 7)) {
441 unsigned CnstOff = CN->getZExtValue();
442 return (CnstOff == (CnstOff & 0x3c));
462 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 10))
473 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 10, 1))
484 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 10, 2))
495 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 10, 3))
506bool MipsSEDAGToDAGISel::selectVSplat(
SDNode *
N,
APInt &Imm,
507 unsigned MinSizeInBits)
const {
516 APInt SplatValue, SplatUndef;
517 unsigned SplatBitSize;
520 if (!
Node->isConstantSplat(SplatValue, SplatUndef, SplatBitSize, HasAnyUndefs,
545bool MipsSEDAGToDAGISel::
547 unsigned ImmBitSize)
const {
549 EVT EltTy =
N->getValueType(0).getVectorElementType();
552 N =
N->getOperand(0);
559 Imm =
CurDAG->getTargetConstant(ImmValue, SDLoc(
N), EltTy);
577bool MipsSEDAGToDAGISel::selectVSplatUimmPow2(
SDValue N,
SDValue &Imm)
const {
582 N =
N->getOperand(0);
608bool MipsSEDAGToDAGISel::selectVSplatMaskL(
SDValue N,
SDValue &Imm)
const {
613 N =
N->getOperand(0);
639bool MipsSEDAGToDAGISel::selectVSplatMaskR(
SDValue N,
SDValue &Imm)
const {
644 N =
N->getOperand(0);
657bool MipsSEDAGToDAGISel::selectVSplatUimmInvPow2(
SDValue N,
663 N =
N->getOperand(0);
667 int32_t
Log2 = (~ImmValue).exactLogBase2();
679bool MipsSEDAGToDAGISel::selectVSplatImmEq1(
SDValue N)
const {
684 N =
N->getOperand(0);
686 return selectVSplat(
N.getNode(), ImmValue, EltTy.
getSizeInBits()) &&
690bool MipsSEDAGToDAGISel::trySelect(
SDNode *Node) {
691 unsigned Opcode =
Node->getOpcode();
703 MVT VT =
Subtarget->isGP64bit() ? MVT::i64 : MVT::i32;
711 EVT NodeTys[] = {VT, VT};
713 ? Mips::PseudoD_SELECT_I64
714 : Mips::PseudoD_SELECT_I,
720 selectAddE(Node,
DL);
726 if (
Node->getValueType(0) == MVT::f64 && CN->isPosZero()) {
729 Mips::ZERO_64, MVT::i64);
731 CurDAG->getMachineNode(Mips::DMTC1,
DL, MVT::f64, Zero));
734 Mips::ZERO, MVT::i32);
736 MVT::f64, Zero, Zero));
739 Mips::ZERO, MVT::i32);
741 MVT::f64, Zero, Zero));
750 int64_t
Imm = CN->getSExtValue();
751 unsigned Size = CN->getValueSizeInBits(0);
756 MipsAnalyzeImmediate AnalyzeImm;
770 if (Inst->Opc == Mips::LUi64)
771 RegOpnd =
CurDAG->getMachineNode(Inst->Opc,
DL, MVT::i64, ImmOpnd);
774 CurDAG->getMachineNode(Inst->Opc,
DL, MVT::i64,
775 CurDAG->getRegister(Mips::ZERO_64, MVT::i64),
779 for (++Inst; Inst != Seq.
end(); ++Inst) {
782 RegOpnd =
CurDAG->getMachineNode(Inst->Opc,
DL, MVT::i64,
791 const unsigned IntrinsicOpcode =
Node->getConstantOperandVal(1);
792 switch (IntrinsicOpcode) {
796 case Intrinsic::mips_cfcmsa: {
800 getMSACtrlReg(RegIdx), MVT::i32);
804 case Intrinsic::mips_ldr_d:
805 case Intrinsic::mips_ldr_w: {
806 unsigned Op = (IntrinsicOpcode == Intrinsic::mips_ldr_d) ? Mips::LDR_D
810 assert(
Node->getNumOperands() == 4 &&
"Unexpected number of operands.");
820 "Invalid instruction operand.");
823 const ConstantInt *Val =
831 assert(
Node->getValueType(0).is128BitVector());
844 switch (
Node->getConstantOperandVal(0)) {
848 case Intrinsic::mips_move_v:
852 Node->getValueType(0),
853 Node->getOperand(1)));
860 const unsigned IntrinsicOpcode =
Node->getConstantOperandVal(1);
861 switch (IntrinsicOpcode) {
865 case Intrinsic::mips_ctcmsa: {
870 getMSACtrlReg(RegIdx),
Value);
874 case Intrinsic::mips_str_d:
875 case Intrinsic::mips_str_w: {
876 unsigned Op = (IntrinsicOpcode == Intrinsic::mips_str_d) ? Mips::STR_D
880 assert(
Node->getNumOperands() == 5 &&
"Unexpected number of operands.");
891 "Invalid instruction operand.");
894 const ConstantInt *Val =
913 MVT ResTy =
Node->getSimpleValueType(0);
914 assert((ResTy == MVT::f64 || ResTy == MVT::f32) &&
915 "Unsupported float type!");
917 if (ResTy == MVT::f64)
918 Opc = (
Subtarget->isFP64bit() ? Mips::FABS_D64 : Mips::FABS_D32);
925 Opc = Mips::FABS_D64_MM;
928 Opc = Mips::FABS_D32_MM;
931 Opc = Mips::FABS_S_MM;
953 if (
Node->getValueType(0) != MVT::i32 &&
Node->getValueType(0) != MVT::i64)
956 if (
Node->getNumOperands() != 4)
963 MVT ResTy =
Node->getSimpleValueType(0);
964 uint64_t Pos =
Node->getConstantOperandVal(1);
965 uint64_t
Size =
Node->getConstantOperandVal(2);
974 if (ResTy != MVT::i32 && ResTy != MVT::i64)
978 if (ResTy == MVT::i32) {
979 if (Pos +
Size <= 32)
982 if (Pos +
Size <= 32)
984 else if (Pos < 32 && 1 <
Size)
985 Opcode = Mips::DINSM;
987 Opcode = Mips::DINSU;
992 Node->getOperand(0),
CurDAG->getTargetConstant(Pos,
DL, MVT::i32),
1002 case MipsISD::ThreadPointer: {
1004 unsigned RdhwrOpc, DestReg;
1006 if (PtrVT == MVT::i32) {
1007 RdhwrOpc = Mips::RDHWR;
1010 RdhwrOpc = Mips::RDHWR64;
1011 DestReg = Mips::V1_64;
1015 CurDAG->getMachineNode(RdhwrOpc,
DL,
Node->getValueType(0), MVT::Glue,
1016 CurDAG->getRegister(Mips::HWR29, MVT::i32),
1017 CurDAG->getTargetConstant(0,
DL, MVT::i32));
1039 const MipsABIInfo &
ABI =
1040 static_cast<const MipsTargetMachine &
>(
TM).getABI();
1043 APInt SplatValue, SplatUndef;
1044 unsigned SplatBitSize;
1058 switch (SplatBitSize) {
1062 LdiOp = Mips::LDI_B;
1063 ViaVecTy = MVT::v16i8;
1066 LdiOp = Mips::LDI_H;
1067 ViaVecTy = MVT::v8i16;
1070 LdiOp = Mips::LDI_W;
1071 ViaVecTy = MVT::v4i32;
1074 LdiOp = Mips::LDI_D;
1075 ViaVecTy = MVT::v2i64;
1079 SDNode *Res =
nullptr;
1089 Res =
CurDAG->getMachineNode(LdiOp,
DL, ViaVecTy, Imm);
1091 ((
ABI.IsO32() && SplatBitSize < 64) ||
1092 (
ABI.IsN32() ||
ABI.IsN64()))) {
1098 bool Is32BitSplat =
ABI.IsO32() || SplatBitSize < 64;
1099 const unsigned ADDiuOp = Is32BitSplat ? Mips::ADDiu : Mips::DADDiu;
1100 const MVT SplatMVT = Is32BitSplat ? MVT::i32 : MVT::i64;
1102 Is32BitSplat ? Mips::ZERO : Mips::ZERO_64, SplatMVT);
1104 const unsigned FILLOp =
1107 : (SplatBitSize == 32 ? Mips::FILL_W
1108 : (SplatBitSize == 64 ? Mips::FILL_D : 0));
1110 assert(FILLOp != 0 &&
"Unknown FILL Op for splat synthesis!");
1111 assert((!
ABI.IsO32() || (FILLOp != Mips::FILL_D)) &&
1112 "Attempting to use fill.d on MIPS32!");
1117 Res =
CurDAG->getMachineNode(ADDiuOp,
DL, SplatMVT, ZeroVal, LoVal);
1120 }
else if (SplatValue.
isSignedIntN(32) && SplatBitSize == 32) {
1125 SDValue ZeroVal =
CurDAG->getRegister(Mips::ZERO, MVT::i32);
1131 Res =
CurDAG->getMachineNode(Mips::LUi,
DL, MVT::i32, HiVal);
1134 Res =
CurDAG->getMachineNode(Mips::ORi,
DL, MVT::i32,
1137 assert((
Hi ||
Lo) &&
"Zero case reached 32 bit case splat synthesis!");
1139 CurDAG->getMachineNode(Mips::FILL_W,
DL, MVT::v4i32,
SDValue(Res, 0));
1141 }
else if (SplatValue.
isSignedIntN(32) && SplatBitSize == 64 &&
1142 (
ABI.IsN32() ||
ABI.IsN64())) {
1148 SDValue ZeroVal =
CurDAG->getRegister(Mips::ZERO, MVT::i32);
1154 Res =
CurDAG->getMachineNode(Mips::LUi,
DL, MVT::i32, HiVal);
1157 Res =
CurDAG->getMachineNode(Mips::ORi,
DL, MVT::i32,
1160 Res =
CurDAG->getMachineNode(
1161 Mips::SUBREG_TO_REG,
DL, MVT::i64,
SDValue(Res, 0),
1162 CurDAG->getTargetConstant(Mips::sub_32,
DL, MVT::i64));
1165 CurDAG->getMachineNode(Mips::FILL_D,
DL, MVT::v2i64,
SDValue(Res, 0));
1201 SDValue HighestVal =
CurDAG->getTargetConstant(Highest,
DL, MVT::i32);
1202 SDValue ZeroVal =
CurDAG->getRegister(Mips::ZERO, MVT::i32);
1221 Res =
CurDAG->getMachineNode(Mips::LUi,
DL, MVT::i32, HiVal);
1224 Res =
CurDAG->getMachineNode(Mips::ORi,
DL, MVT::i32,
1229 HiRes =
CurDAG->getMachineNode(Mips::LUi,
DL, MVT::i32, HighestVal);
1232 HiRes =
CurDAG->getMachineNode(Mips::ORi,
DL, MVT::i32,
1233 Highest ?
SDValue(HiRes, 0) : ZeroVal,
1238 Res =
CurDAG->getMachineNode(Mips::FILL_W,
DL, MVT::v4i32,
1241 Res =
CurDAG->getMachineNode(
1242 Mips::INSERT_W,
DL, MVT::v4i32,
SDValue(Res, 0),
1243 (Highest || Higher) ?
SDValue(HiRes, 0) : ZeroVal,
1244 CurDAG->getTargetConstant(1,
DL, MVT::i32));
1250 Res =
CurDAG->getMachineNode(
1251 Mips::COPY_TO_REGCLASS,
DL, ViaVecTy,
SDValue(Res, 0),
1254 Res =
CurDAG->getMachineNode(
1255 Mips::SPLATI_D,
DL, MVT::v2i64,
SDValue(Res, 0),
1256 CurDAG->getTargetConstant(0,
DL, MVT::i32));
1257 }
else if (
ABI.IsN64() ||
ABI.IsN32()) {
1259 SDValue Zero64Val =
CurDAG->getRegister(Mips::ZERO_64, MVT::i64);
1260 const bool HiResNonZero = Highest || Higher;
1261 const bool ResNonZero =
Hi ||
Lo;
1264 HiRes =
CurDAG->getMachineNode(
1265 Mips::SUBREG_TO_REG,
DL, MVT::i64,
SDValue(HiRes, 0),
1266 CurDAG->getTargetConstant(Mips::sub_32,
DL, MVT::i64));
1269 Res =
CurDAG->getMachineNode(
1270 Mips::SUBREG_TO_REG,
DL, MVT::i64,
SDValue(Res, 0),
1271 CurDAG->getTargetConstant(Mips::sub_32,
DL, MVT::i64));
1281 IntegerType *Int32Ty =
1283 const ConstantInt *Const32 = ConstantInt::get(Int32Ty, 32);
1289 Res =
CurDAG->getMachineNode(Mips::DINSU,
DL, MVT::i64,
Ops);
1290 }
else if (HiResNonZero) {
1291 Res =
CurDAG->getMachineNode(
1292 Mips::DSLL32,
DL, MVT::i64,
SDValue(HiRes, 0),
1293 CurDAG->getTargetConstant(0,
DL, MVT::i32));
1296 "Zero splat value handled by non-zero 64bit splat synthesis!");
1298 Res =
CurDAG->getMachineNode(Mips::FILL_D,
DL, MVT::v2i64,
1306 if (ResVecTy != ViaVecTy) {
1314 Res =
CurDAG->getMachineNode(Mips::COPY_TO_REGCLASS,
DL,
1329bool MipsSEDAGToDAGISel::SelectInlineAsmMemoryOperand(
1331 std::vector<SDValue> &OutOps) {
1334 switch(ConstraintID) {
1341 OutOps.push_back(
Base);
1342 OutOps.push_back(
Offset);
1345 OutOps.push_back(
Op);
1346 OutOps.push_back(
CurDAG->getTargetConstant(0, SDLoc(
Op), MVT::i32));
1355 OutOps.push_back(
Base);
1356 OutOps.push_back(
Offset);
1359 OutOps.push_back(
Op);
1360 OutOps.push_back(
CurDAG->getTargetConstant(0, SDLoc(
Op), MVT::i32));
1368 OutOps.push_back(
Base);
1369 OutOps.push_back(
Offset);
1375 OutOps.push_back(
Base);
1376 OutOps.push_back(
Offset);
1381 OutOps.push_back(
Base);
1382 OutOps.push_back(
Offset);
1386 OutOps.push_back(
Op);
1387 OutOps.push_back(
CurDAG->getTargetConstant(0, SDLoc(
Op), MVT::i32));
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static uint64_t getConstant(const Value *IndexValue)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
static bool initGlobalBaseReg(MachineFunction &MF)
Class for arbitrary precision integers.
LLVM_ABI APInt getLoBits(unsigned numBits) const
Compute an APInt containing numBits lowbits from this APInt.
uint64_t getZExtValue() const
Get zero extended value.
unsigned popcount() const
Count the number of bits set.
unsigned getBitWidth() const
Return the number of bits in the APInt.
bool isNegative() const
Determine sign of this APInt.
int32_t exactLogBase2() const
bool isSignedIntN(unsigned N) const
Check if this APInt has an N-bits signed integer value.
bool isShiftedMask() const
Return true if this APInt value contains a non-empty sequence of ones with the remainder zero.
bool isMask(unsigned numBits) const
bool isIntN(unsigned N) const
Check if this APInt has an N-bits unsigned integer value.
APInt lshr(unsigned shiftAmt) const
Logical right-shift function.
Represent the analysis usage information of a pass.
LLVM_ABI 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.
FunctionPass class - This class is used to implement most global optimizations.
static LLVM_ABI IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
unsigned getID() const
getID() - Return the register class ID number.
bool contains(MCRegister Reg) const
contains - Return true if the specified register is included in this register class.
Wrapper class representing physical registers. Should be passed by value.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const MachineInstrBuilder & addUse(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a virtual register use operand.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addDef(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a virtual register definition operand.
Representation of each machine instruction.
LLVM_ABI void setReg(Register Reg)
Change the register this operand corresponds to.
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
Register getReg() const
getReg - Returns the register number.
static MachineOperand CreateReg(Register 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)
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
const TargetRegisterClass * getRegClass(Register Reg) const
Return the register class of the specified virtual register.
defusechain_iterator< true, false, false, true, false > use_iterator
use_iterator/use_begin/use_end - Walk all uses of the specified register.
use_iterator use_begin(Register RegNo) const
static use_iterator use_end()
MipsDAGToDAGISelLegacy(std::unique_ptr< SelectionDAGISel > S)
bool runOnMachineFunction(MachineFunction &MF) override
const MipsSubtarget * Subtarget
Keep a pointer to the MipsSubtarget around so that we can make the right decision when generating cod...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
MipsSEDAGToDAGISelLegacy(MipsTargetMachine &TM, CodeGenOptLevel OL)
bool inMips16Mode() const
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
uint64_t getAsZExtVal() const
Helper method returns the zero-extended integer value of a ConstantSDNode.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getValue(unsigned R) const
EVT getValueType() const
Return the ValueType of the referenced return value.
const SDValue & getOperand(unsigned i) const
unsigned getOpcode() const
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const TargetLowering * TLI
const TargetInstrInfo * TII
void ReplaceNode(SDNode *F, SDNode *T)
Replace all uses of F with T, then remove F from the DAG.
const TargetLowering * getTargetLowering() const
virtual 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...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
@ ADDC
Carry-setting nodes for multiple precision addition and subtraction.
@ ADD
Simple integer binary arithmetic operators.
@ INTRINSIC_VOID
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
@ BITCAST
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
@ TargetGlobalAddress
TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or anything else with this node...
@ TargetConstant
TargetConstant* - Like Constant*, but the DAG does not do any folding, simplification,...
@ INTRINSIC_WO_CHAIN
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
@ ADDE
Carry-using nodes for multiple precision addition and subtraction.
@ INTRINSIC_W_CHAIN
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
@ BUILD_VECTOR
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector with the specified,...
NodeAddr< NodeBase * > Node
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
RegState
Flags to represent properties of register accesses.
@ Implicit
Not emitted register (e.g. carry, or temporary result).
@ Undef
Value of the register doesn't matter.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
bool isAligned(Align Lhs, uint64_t SizeInBytes)
Checks that SizeInBytes is a multiple of the alignment.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
FunctionPass * createMipsSEISelDag(MipsTargetMachine &TM, CodeGenOptLevel OptLevel)
CodeGenOptLevel
Code generation optimization level.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
DWARFExpression::Operation Op
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
constexpr bool isIntN(unsigned N, int64_t x)
Checks if an signed integer fits into the given (dynamic) bit width.
constexpr int64_t SignExtend64(uint64_t x)
Sign-extend the number in the bottom B bits of X to a 64-bit integer.
unsigned Log2(Align A)
Returns the log2 of the alignment.
MCRegisterClass TargetRegisterClass
Implement std::hash so that hash_code can be used in STL containers.
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
bool is128BitVector() const
Return true if this is a 128-bit vector type.
EVT getVectorElementType() const
Given a vector type, return the type of each element.