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);
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);
293 if (!
isAligned(Alignment, CN->getZExtValue()))
297 Offset =
CurDAG->getTargetConstant(CN->getZExtValue(), SDLoc(Addr),
308 if (
Base.getOperand(1).getOpcode() == MipsISD::Lo ||
309 Base.getOperand(1).getOpcode() == MipsISD::GPRel) {
313 else if (GlobalAddressSDNode *GA =
316 const GlobalValue *GV = GA->getGlobal();
317 int64_t GAOffset = GA->getOffset();
319 GV, SDLoc(Addr), MVT::i32, GAOffset + CN->getZExtValue(),
340 if (Addr.
getOpcode() == MipsISD::Wrapper) {
346 if (!
TM.isPositionIndependent()) {
353 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 16))
392 return selectAddrRegImm(Addr,
Base,
Offset) ||
401 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 9))
413 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 11))
425 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 12))
436 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 16))
444 return selectAddrRegImm11(Addr,
Base,
Offset) ||
450 return selectAddrRegImm12(Addr,
Base,
Offset) ||
456 return selectAddrRegImm16(Addr,
Base,
Offset) ||
462 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 7)) {
467 unsigned CnstOff = CN->getZExtValue();
468 return (CnstOff == (CnstOff & 0x3c));
488 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 10))
499 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 10, 1))
510 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 10, 2))
521 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 10, 3))
533 unsigned MinSizeInBits)
const {
542 APInt SplatValue, SplatUndef;
543 unsigned SplatBitSize;
546 if (!
Node->isConstantSplat(SplatValue, SplatUndef, SplatBitSize, HasAnyUndefs,
571bool MipsSEDAGToDAGISel::
573 unsigned ImmBitSize)
const {
575 EVT EltTy =
N->getValueType(0).getVectorElementType();
578 N =
N->getOperand(0);
585 Imm =
CurDAG->getTargetConstant(ImmValue, SDLoc(
N), EltTy);
608 N =
N->getOperand(0);
639 N =
N->getOperand(0);
670 N =
N->getOperand(0);
683bool MipsSEDAGToDAGISel::selectVSplatUimmInvPow2(
SDValue N,
689 N =
N->getOperand(0);
693 int32_t
Log2 = (~ImmValue).exactLogBase2();
705bool MipsSEDAGToDAGISel::selectVSplatImmEq1(
SDValue N)
const {
710 N =
N->getOperand(0);
712 return selectVSplat(
N.getNode(), ImmValue, EltTy.
getSizeInBits()) &&
716bool MipsSEDAGToDAGISel::trySelect(
SDNode *Node) {
717 unsigned Opcode =
Node->getOpcode();
729 MVT VT =
Subtarget->isGP64bit() ? MVT::i64 : MVT::i32;
737 EVT NodeTys[] = {VT, VT};
739 ? Mips::PseudoD_SELECT_I64
740 : Mips::PseudoD_SELECT_I,
746 selectAddE(Node,
DL);
752 if (
Node->getValueType(0) == MVT::f64 && CN->isPosZero()) {
755 Mips::ZERO_64, MVT::i64);
757 CurDAG->getMachineNode(Mips::DMTC1,
DL, MVT::f64, Zero));
760 Mips::ZERO, MVT::i32);
762 MVT::f64, Zero, Zero));
765 Mips::ZERO, MVT::i32);
767 MVT::f64, Zero, Zero));
776 int64_t
Imm = CN->getSExtValue();
777 unsigned Size = CN->getValueSizeInBits(0);
782 MipsAnalyzeImmediate AnalyzeImm;
796 if (Inst->Opc == Mips::LUi64)
797 RegOpnd =
CurDAG->getMachineNode(Inst->Opc,
DL, MVT::i64, ImmOpnd);
800 CurDAG->getMachineNode(Inst->Opc,
DL, MVT::i64,
801 CurDAG->getRegister(Mips::ZERO_64, MVT::i64),
805 for (++Inst; Inst != Seq.
end(); ++Inst) {
808 RegOpnd =
CurDAG->getMachineNode(Inst->Opc,
DL, MVT::i64,
817 const unsigned IntrinsicOpcode =
Node->getConstantOperandVal(1);
818 switch (IntrinsicOpcode) {
822 case Intrinsic::mips_cfcmsa: {
826 getMSACtrlReg(RegIdx), MVT::i32);
830 case Intrinsic::mips_ldr_d:
831 case Intrinsic::mips_ldr_w: {
832 unsigned Op = (IntrinsicOpcode == Intrinsic::mips_ldr_d) ? Mips::LDR_D
836 assert(
Node->getNumOperands() == 4 &&
"Unexpected number of operands.");
846 "Invalid instruction operand.");
849 const ConstantInt *Val =
857 assert(
Node->getValueType(0).is128BitVector());
870 switch (
Node->getConstantOperandVal(0)) {
874 case Intrinsic::mips_move_v:
878 Node->getValueType(0),
879 Node->getOperand(1)));
886 const unsigned IntrinsicOpcode =
Node->getConstantOperandVal(1);
887 switch (IntrinsicOpcode) {
891 case Intrinsic::mips_ctcmsa: {
896 getMSACtrlReg(RegIdx),
Value);
900 case Intrinsic::mips_str_d:
901 case Intrinsic::mips_str_w: {
902 unsigned Op = (IntrinsicOpcode == Intrinsic::mips_str_d) ? Mips::STR_D
906 assert(
Node->getNumOperands() == 5 &&
"Unexpected number of operands.");
917 "Invalid instruction operand.");
920 const ConstantInt *Val =
939 MVT ResTy =
Node->getSimpleValueType(0);
940 assert((ResTy == MVT::f64 || ResTy == MVT::f32) &&
941 "Unsupported float type!");
943 if (ResTy == MVT::f64)
944 Opc = (
Subtarget->isFP64bit() ? Mips::FABS_D64 : Mips::FABS_D32);
951 Opc = Mips::FABS_D64_MM;
954 Opc = Mips::FABS_D32_MM;
957 Opc = Mips::FABS_S_MM;
979 if (
Node->getValueType(0) != MVT::i32 &&
Node->getValueType(0) != MVT::i64)
982 if (
Node->getNumOperands() != 4)
989 MVT ResTy =
Node->getSimpleValueType(0);
1000 if (ResTy != MVT::i32 && ResTy != MVT::i64)
1003 unsigned Opcode = 0;
1004 if (ResTy == MVT::i32) {
1005 if (Pos +
Size <= 32)
1008 if (Pos +
Size <= 32)
1009 Opcode = Mips::DINS;
1010 else if (Pos < 32 && 1 <
Size)
1011 Opcode = Mips::DINSM;
1013 Opcode = Mips::DINSU;
1018 Node->getOperand(0),
CurDAG->getTargetConstant(Pos,
DL, MVT::i32),
1028 case MipsISD::ThreadPointer: {
1030 unsigned RdhwrOpc, DestReg;
1032 if (PtrVT == MVT::i32) {
1033 RdhwrOpc = Mips::RDHWR;
1036 RdhwrOpc = Mips::RDHWR64;
1037 DestReg = Mips::V1_64;
1041 CurDAG->getMachineNode(RdhwrOpc,
DL,
Node->getValueType(0), MVT::Glue,
1042 CurDAG->getRegister(Mips::HWR29, MVT::i32),
1043 CurDAG->getTargetConstant(0,
DL, MVT::i32));
1065 const MipsABIInfo &
ABI =
1066 static_cast<const MipsTargetMachine &
>(
TM).getABI();
1069 APInt SplatValue, SplatUndef;
1070 unsigned SplatBitSize;
1084 switch (SplatBitSize) {
1088 LdiOp = Mips::LDI_B;
1089 ViaVecTy = MVT::v16i8;
1092 LdiOp = Mips::LDI_H;
1093 ViaVecTy = MVT::v8i16;
1096 LdiOp = Mips::LDI_W;
1097 ViaVecTy = MVT::v4i32;
1100 LdiOp = Mips::LDI_D;
1101 ViaVecTy = MVT::v2i64;
1105 SDNode *Res =
nullptr;
1115 Res =
CurDAG->getMachineNode(LdiOp,
DL, ViaVecTy,
Imm);
1117 ((
ABI.IsO32() && SplatBitSize < 64) ||
1118 (
ABI.IsN32() ||
ABI.IsN64()))) {
1124 bool Is32BitSplat =
ABI.IsO32() || SplatBitSize < 64;
1125 const unsigned ADDiuOp = Is32BitSplat ? Mips::ADDiu : Mips::DADDiu;
1126 const MVT SplatMVT = Is32BitSplat ? MVT::i32 : MVT::i64;
1128 Is32BitSplat ? Mips::ZERO : Mips::ZERO_64, SplatMVT);
1130 const unsigned FILLOp =
1133 : (SplatBitSize == 32 ? Mips::FILL_W
1134 : (SplatBitSize == 64 ? Mips::FILL_D : 0));
1136 assert(FILLOp != 0 &&
"Unknown FILL Op for splat synthesis!");
1137 assert((!
ABI.IsO32() || (FILLOp != Mips::FILL_D)) &&
1138 "Attempting to use fill.d on MIPS32!");
1143 Res =
CurDAG->getMachineNode(ADDiuOp,
DL, SplatMVT, ZeroVal, LoVal);
1146 }
else if (SplatValue.
isSignedIntN(32) && SplatBitSize == 32) {
1151 SDValue ZeroVal =
CurDAG->getRegister(Mips::ZERO, MVT::i32);
1157 Res =
CurDAG->getMachineNode(Mips::LUi,
DL, MVT::i32, HiVal);
1160 Res =
CurDAG->getMachineNode(Mips::ORi,
DL, MVT::i32,
1163 assert((
Hi ||
Lo) &&
"Zero case reached 32 bit case splat synthesis!");
1165 CurDAG->getMachineNode(Mips::FILL_W,
DL, MVT::v4i32,
SDValue(Res, 0));
1167 }
else if (SplatValue.
isSignedIntN(32) && SplatBitSize == 64 &&
1168 (
ABI.IsN32() ||
ABI.IsN64())) {
1174 SDValue ZeroVal =
CurDAG->getRegister(Mips::ZERO, MVT::i32);
1180 Res =
CurDAG->getMachineNode(Mips::LUi,
DL, MVT::i32, HiVal);
1183 Res =
CurDAG->getMachineNode(Mips::ORi,
DL, MVT::i32,
1186 Res =
CurDAG->getMachineNode(
1187 Mips::SUBREG_TO_REG,
DL, MVT::i64,
SDValue(Res, 0),
1188 CurDAG->getTargetConstant(Mips::sub_32,
DL, MVT::i64));
1191 CurDAG->getMachineNode(Mips::FILL_D,
DL, MVT::v2i64,
SDValue(Res, 0));
1227 SDValue HighestVal =
CurDAG->getTargetConstant(Highest,
DL, MVT::i32);
1228 SDValue ZeroVal =
CurDAG->getRegister(Mips::ZERO, MVT::i32);
1247 Res =
CurDAG->getMachineNode(Mips::LUi,
DL, MVT::i32, HiVal);
1250 Res =
CurDAG->getMachineNode(Mips::ORi,
DL, MVT::i32,
1255 HiRes =
CurDAG->getMachineNode(Mips::LUi,
DL, MVT::i32, HighestVal);
1258 HiRes =
CurDAG->getMachineNode(Mips::ORi,
DL, MVT::i32,
1259 Highest ?
SDValue(HiRes, 0) : ZeroVal,
1264 Res =
CurDAG->getMachineNode(Mips::FILL_W,
DL, MVT::v4i32,
1267 Res =
CurDAG->getMachineNode(
1268 Mips::INSERT_W,
DL, MVT::v4i32,
SDValue(Res, 0),
1269 (Highest || Higher) ?
SDValue(HiRes, 0) : ZeroVal,
1270 CurDAG->getTargetConstant(1,
DL, MVT::i32));
1276 Res =
CurDAG->getMachineNode(
1277 Mips::COPY_TO_REGCLASS,
DL, ViaVecTy,
SDValue(Res, 0),
1280 Res =
CurDAG->getMachineNode(
1281 Mips::SPLATI_D,
DL, MVT::v2i64,
SDValue(Res, 0),
1282 CurDAG->getTargetConstant(0,
DL, MVT::i32));
1283 }
else if (
ABI.IsN64() ||
ABI.IsN32()) {
1285 SDValue Zero64Val =
CurDAG->getRegister(Mips::ZERO_64, MVT::i64);
1286 const bool HiResNonZero = Highest || Higher;
1287 const bool ResNonZero =
Hi ||
Lo;
1290 HiRes =
CurDAG->getMachineNode(
1291 Mips::SUBREG_TO_REG,
DL, MVT::i64,
SDValue(HiRes, 0),
1292 CurDAG->getTargetConstant(Mips::sub_32,
DL, MVT::i64));
1295 Res =
CurDAG->getMachineNode(
1296 Mips::SUBREG_TO_REG,
DL, MVT::i64,
SDValue(Res, 0),
1297 CurDAG->getTargetConstant(Mips::sub_32,
DL, MVT::i64));
1307 IntegerType *Int32Ty =
1309 const ConstantInt *Const32 = ConstantInt::get(Int32Ty, 32);
1315 Res =
CurDAG->getMachineNode(Mips::DINSU,
DL, MVT::i64,
Ops);
1316 }
else if (HiResNonZero) {
1317 Res =
CurDAG->getMachineNode(
1318 Mips::DSLL32,
DL, MVT::i64,
SDValue(HiRes, 0),
1319 CurDAG->getTargetConstant(0,
DL, MVT::i32));
1322 "Zero splat value handled by non-zero 64bit splat synthesis!");
1324 Res =
CurDAG->getMachineNode(Mips::FILL_D,
DL, MVT::v2i64,
1332 if (ResVecTy != ViaVecTy) {
1340 Res =
CurDAG->getMachineNode(Mips::COPY_TO_REGCLASS,
DL,
1355bool MipsSEDAGToDAGISel::SelectInlineAsmMemoryOperand(
1357 std::vector<SDValue> &OutOps) {
1360 switch(ConstraintID) {
1367 OutOps.push_back(
Base);
1368 OutOps.push_back(
Offset);
1371 OutOps.push_back(
Op);
1372 OutOps.push_back(
CurDAG->getTargetConstant(0, SDLoc(
Op), MVT::i32));
1381 OutOps.push_back(
Base);
1382 OutOps.push_back(
Offset);
1385 OutOps.push_back(
Op);
1386 OutOps.push_back(
CurDAG->getTargetConstant(0, SDLoc(
Op), MVT::i32));
1394 OutOps.push_back(
Base);
1395 OutOps.push_back(
Offset);
1401 OutOps.push_back(
Base);
1402 OutOps.push_back(
Offset);
1407 OutOps.push_back(
Base);
1408 OutOps.push_back(
Offset);
1412 OutOps.push_back(
Op);
1413 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.