28#include "llvm/IR/IntrinsicsMips.h"
35#define DEBUG_TYPE "mips-isel"
48void MipsSEDAGToDAGISel::addDSPCtrlRegOperands(
bool IsDef,
MachineInstr &
MI,
51 unsigned Mask =
MI.getOperand(1).getImm();
56 MIB.addReg(Mips::DSPPos, Flag);
59 MIB.addReg(Mips::DSPSCount, Flag);
62 MIB.addReg(Mips::DSPCarry, Flag);
65 MIB.addReg(Mips::DSPOutFlag, Flag);
68 MIB.addReg(Mips::DSPCCond, Flag);
71 MIB.addReg(Mips::DSPEFI, Flag);
76 return Mips::MSACtrlRegClass.getRegister(RegNum);
81 unsigned DstReg = 0, ZeroReg = 0;
84 if ((
MI.getOpcode() == Mips::ADDiu) &&
85 (
MI.getOperand(1).getReg() == Mips::R0) && (
MI.getOperand(2).isImm()) &&
86 (
MI.getOperand(2).getImm() == 0)) {
87 DstReg =
MI.getOperand(0).getReg();
89 }
else if ((
MI.getOpcode() == Mips::DADDiu) &&
90 (
MI.getOperand(1).getReg() == Mips::R0_64) &&
91 (
MI.getOperand(2).isImm()) && (
MI.getOperand(2).getImm() == 0)) {
92 DstReg =
MI.getOperand(0).getReg();
93 ZeroReg = Mips::R0_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),
312 (
Base.getOperand(1).getOpcode() == MipsISD::Lo ||
313 Base.getOperand(1).getOpcode() == MipsISD::GPRel)) {
315 int64_t
Off = CN->getSExtValue();
319 GA->getGlobal()->getPointerAlignment(
CurDAG->getDataLayout()),
322 SymOffset =
CurDAG->getTargetGlobalAddress(
323 GA->getGlobal(), SDLoc(Addr), ValTy, GA->getOffset() +
Off,
324 GA->getTargetFlags());
328 SymOffset = CP->isMachineConstantPoolEntry()
329 ?
CurDAG->getTargetConstantPool(
330 CP->getMachineCPVal(), ValTy, CP->getAlign(),
331 CP->getOffset() +
Off, CP->getTargetFlags())
332 :
CurDAG->getTargetConstantPool(
333 CP->getConstVal(), ValTy, CP->getAlign(),
334 CP->getOffset() +
Off, CP->getTargetFlags());
356 if (Addr.
getOpcode() == MipsISD::Wrapper) {
362 if (!
TM.isPositionIndependent()) {
369 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 16))
408 return selectAddrRegImm(Addr,
Base,
Offset) ||
417 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 9))
429 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 11))
441 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 12))
452 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 16))
460 return selectAddrRegImm11(Addr,
Base,
Offset) ||
466 return selectAddrRegImm12(Addr,
Base,
Offset) ||
472 return selectAddrRegImm16(Addr,
Base,
Offset) ||
478 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 7)) {
483 unsigned CnstOff = CN->getZExtValue();
484 return (CnstOff == (CnstOff & 0x3c));
504 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 10))
515 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 10, 1))
526 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 10, 2))
537 if (selectAddrFrameIndexOffset(Addr,
Base,
Offset, 10, 3))
549 unsigned MinSizeInBits)
const {
558 APInt SplatValue, SplatUndef;
559 unsigned SplatBitSize;
562 if (!
Node->isConstantSplat(SplatValue, SplatUndef, SplatBitSize, HasAnyUndefs,
587bool MipsSEDAGToDAGISel::
589 unsigned ImmBitSize)
const {
591 EVT EltTy =
N->getValueType(0).getVectorElementType();
594 N =
N->getOperand(0);
601 Imm =
CurDAG->getTargetConstant(ImmValue, SDLoc(
N), EltTy);
624 N =
N->getOperand(0);
655 N =
N->getOperand(0);
686 N =
N->getOperand(0);
699bool MipsSEDAGToDAGISel::selectVSplatUimmInvPow2(
SDValue N,
705 N =
N->getOperand(0);
709 int32_t
Log2 = (~ImmValue).exactLogBase2();
721bool MipsSEDAGToDAGISel::selectVSplatImmEq1(
SDValue N)
const {
726 N =
N->getOperand(0);
728 return selectVSplat(
N.getNode(), ImmValue, EltTy.
getSizeInBits()) &&
732bool MipsSEDAGToDAGISel::trySelect(
SDNode *Node) {
733 unsigned Opcode =
Node->getOpcode();
745 MVT VT =
Subtarget->isGP64bit() ? MVT::i64 : MVT::i32;
753 EVT NodeTys[] = {VT, VT};
755 ? Mips::PseudoD_SELECT_I64
756 : Mips::PseudoD_SELECT_I,
762 selectAddE(Node,
DL);
768 if (
Node->getValueType(0) == MVT::f64 && CN->isPosZero()) {
771 Mips::R0_64, MVT::i64);
773 CurDAG->getMachineNode(Mips::DMTC1,
DL, MVT::f64,
Zero));
792 int64_t
Imm = CN->getSExtValue();
793 unsigned Size = CN->getValueSizeInBits(0);
798 MipsAnalyzeImmediate AnalyzeImm;
812 if (Inst->Opc == Mips::LUi64)
813 RegOpnd =
CurDAG->getMachineNode(Inst->Opc,
DL, MVT::i64, ImmOpnd);
815 RegOpnd =
CurDAG->getMachineNode(
816 Inst->Opc,
DL, MVT::i64,
CurDAG->getRegister(Mips::R0_64, MVT::i64),
820 for (++Inst; Inst != Seq.
end(); ++Inst) {
823 RegOpnd =
CurDAG->getMachineNode(Inst->Opc,
DL, MVT::i64,
832 const unsigned IntrinsicOpcode =
Node->getConstantOperandVal(1);
833 switch (IntrinsicOpcode) {
837 case Intrinsic::mips_cfcmsa: {
841 getMSACtrlReg(RegIdx), MVT::i32);
845 case Intrinsic::mips_ldr_d:
846 case Intrinsic::mips_ldr_w: {
847 unsigned Op = (IntrinsicOpcode == Intrinsic::mips_ldr_d) ? Mips::LDR_D
851 assert(
Node->getNumOperands() == 4 &&
"Unexpected number of operands.");
861 "Invalid instruction operand.");
864 const ConstantInt *Val =
872 assert(
Node->getValueType(0).is128BitVector());
885 switch (
Node->getConstantOperandVal(0)) {
889 case Intrinsic::mips_move_v:
893 Node->getValueType(0),
894 Node->getOperand(1)));
901 const unsigned IntrinsicOpcode =
Node->getConstantOperandVal(1);
902 switch (IntrinsicOpcode) {
906 case Intrinsic::mips_ctcmsa: {
911 getMSACtrlReg(RegIdx),
Value);
915 case Intrinsic::mips_str_d:
916 case Intrinsic::mips_str_w: {
917 unsigned Op = (IntrinsicOpcode == Intrinsic::mips_str_d) ? Mips::STR_D
921 assert(
Node->getNumOperands() == 5 &&
"Unexpected number of operands.");
932 "Invalid instruction operand.");
935 const ConstantInt *Val =
954 MVT ResTy =
Node->getSimpleValueType(0);
955 assert((ResTy == MVT::f64 || ResTy == MVT::f32) &&
956 "Unsupported float type!");
958 if (ResTy == MVT::f64)
959 Opc = (
Subtarget->isFP64bit() ? Mips::FABS_D64 : Mips::FABS_D32);
966 Opc = Mips::FABS_D64_MM;
969 Opc = Mips::FABS_D32_MM;
972 Opc = Mips::FABS_S_MM;
994 if (
Node->getValueType(0) != MVT::i32 &&
Node->getValueType(0) != MVT::i64)
997 if (
Node->getNumOperands() != 4)
1004 MVT ResTy =
Node->getSimpleValueType(0);
1012 if (Pos +
Size > 64)
1015 if (ResTy != MVT::i32 && ResTy != MVT::i64)
1018 unsigned Opcode = 0;
1019 if (ResTy == MVT::i32) {
1020 if (Pos +
Size <= 32)
1023 if (Pos +
Size <= 32)
1024 Opcode = Mips::DINS;
1025 else if (Pos < 32 && 1 <
Size)
1026 Opcode = Mips::DINSM;
1028 Opcode = Mips::DINSU;
1033 Node->getOperand(0),
CurDAG->getTargetConstant(Pos,
DL, MVT::i32),
1043 case MipsISD::ThreadPointer: {
1045 unsigned RdhwrOpc, DestReg;
1047 if (PtrVT == MVT::i32) {
1048 RdhwrOpc = Mips::RDHWR;
1051 RdhwrOpc = Mips::RDHWR64;
1052 DestReg = Mips::R3_64;
1056 CurDAG->getMachineNode(RdhwrOpc,
DL,
Node->getValueType(0), MVT::Glue,
1057 CurDAG->getRegister(Mips::HWR29, MVT::i32),
1058 CurDAG->getTargetConstant(0,
DL, MVT::i32));
1083 APInt SplatValue, SplatUndef;
1084 unsigned SplatBitSize;
1098 HasAnyUndefs, 8,
false))
1101 switch (SplatBitSize) {
1105 LdiOp = Mips::LDI_B;
1106 ViaVecTy = MVT::v16i8;
1109 LdiOp = Mips::LDI_H;
1110 ViaVecTy = MVT::v8i16;
1113 LdiOp = Mips::LDI_W;
1114 ViaVecTy = MVT::v4i32;
1117 LdiOp = Mips::LDI_D;
1118 ViaVecTy = MVT::v2i64;
1122 SDNode *Res =
nullptr;
1132 Res =
CurDAG->getMachineNode(LdiOp,
DL, ViaVecTy,
Imm);
1134 ((
ABI.IsO32() && SplatBitSize < 64) ||
1135 (
ABI.IsN32() ||
ABI.IsN64()))) {
1141 bool Is32BitSplat =
ABI.IsO32() || SplatBitSize < 64;
1142 const unsigned ADDiuOp = Is32BitSplat ? Mips::ADDiu : Mips::DADDiu;
1143 const MVT SplatMVT = Is32BitSplat ? MVT::i32 : MVT::i64;
1145 CurDAG->getRegister(Is32BitSplat ? Mips::R0 : Mips::R0_64, SplatMVT);
1147 const unsigned FILLOp =
1150 : (SplatBitSize == 32 ? Mips::FILL_W
1151 : (SplatBitSize == 64 ? Mips::FILL_D : 0));
1153 assert(FILLOp != 0 &&
"Unknown FILL Op for splat synthesis!");
1154 assert((!
ABI.IsO32() || (FILLOp != Mips::FILL_D)) &&
1155 "Attempting to use fill.d on MIPS32!");
1160 Res =
CurDAG->getMachineNode(ADDiuOp,
DL, SplatMVT, ZeroVal, LoVal);
1163 }
else if (SplatValue.
isSignedIntN(32) && SplatBitSize == 32) {
1174 Res =
CurDAG->getMachineNode(Mips::LUi,
DL, MVT::i32, HiVal);
1177 Res =
CurDAG->getMachineNode(Mips::ORi,
DL, MVT::i32,
1180 assert((
Hi ||
Lo) &&
"Zero case reached 32 bit case splat synthesis!");
1182 CurDAG->getMachineNode(Mips::FILL_W,
DL, MVT::v4i32,
SDValue(Res, 0));
1184 }
else if (SplatValue.
isSignedIntN(32) && SplatBitSize == 64 &&
1185 (
ABI.IsN32() ||
ABI.IsN64())) {
1197 Res =
CurDAG->getMachineNode(Mips::LUi,
DL, MVT::i32, HiVal);
1200 Res =
CurDAG->getMachineNode(Mips::ORi,
DL, MVT::i32,
1203 Res =
CurDAG->getMachineNode(
1204 Mips::SUBREG_TO_REG,
DL, MVT::i64,
SDValue(Res, 0),
1205 CurDAG->getTargetConstant(Mips::sub_32,
DL, MVT::i64));
1208 CurDAG->getMachineNode(Mips::FILL_D,
DL, MVT::v2i64,
SDValue(Res, 0));
1244 SDValue HighestVal =
CurDAG->getTargetConstant(Highest,
DL, MVT::i32);
1264 Res =
CurDAG->getMachineNode(Mips::LUi,
DL, MVT::i32, HiVal);
1267 Res =
CurDAG->getMachineNode(Mips::ORi,
DL, MVT::i32,
1272 HiRes =
CurDAG->getMachineNode(Mips::LUi,
DL, MVT::i32, HighestVal);
1275 HiRes =
CurDAG->getMachineNode(Mips::ORi,
DL, MVT::i32,
1276 Highest ?
SDValue(HiRes, 0) : ZeroVal,
1281 Res =
CurDAG->getMachineNode(Mips::FILL_W,
DL, MVT::v4i32,
1284 Res =
CurDAG->getMachineNode(
1285 Mips::INSERT_W,
DL, MVT::v4i32,
SDValue(Res, 0),
1286 (Highest || Higher) ?
SDValue(HiRes, 0) : ZeroVal,
1287 CurDAG->getTargetConstant(1,
DL, MVT::i32));
1293 Res =
CurDAG->getMachineNode(
1294 Mips::COPY_TO_REGCLASS,
DL, ViaVecTy,
SDValue(Res, 0),
1297 Res =
CurDAG->getMachineNode(
1298 Mips::SPLATI_D,
DL, MVT::v2i64,
SDValue(Res, 0),
1299 CurDAG->getTargetConstant(0,
DL, MVT::i32));
1300 }
else if (
ABI.IsN64() ||
ABI.IsN32()) {
1302 SDValue Zero64Val =
CurDAG->getRegister(Mips::R0_64, MVT::i64);
1303 const bool HiResNonZero = Highest || Higher;
1304 const bool ResNonZero =
Hi ||
Lo;
1308 CurDAG->getMachineNode(Mips::IMPLICIT_DEF,
DL, MVT::i64), 0);
1312 ->getTargetInsertSubreg(Mips::sub_32,
DL, MVT::i64,
1313 Undef64Val,
SDValue(HiRes, 0))
1318 ->getTargetInsertSubreg(Mips::sub_32,
DL, MVT::i64,
1330 IntegerType *Int32Ty =
1332 const ConstantInt *Const32 = ConstantInt::get(Int32Ty, 32);
1338 Res =
CurDAG->getMachineNode(Mips::DINSU,
DL, MVT::i64,
Ops);
1339 }
else if (HiResNonZero) {
1340 Res =
CurDAG->getMachineNode(
1341 Mips::DSLL32,
DL, MVT::i64,
SDValue(HiRes, 0),
1342 CurDAG->getTargetConstant(0,
DL, MVT::i32));
1345 "Zero splat value handled by non-zero 64bit splat synthesis!");
1347 Res =
CurDAG->getMachineNode(Mips::FILL_D,
DL, MVT::v2i64,
1355 if (ResVecTy != ViaVecTy) {
1363 Res =
CurDAG->getMachineNode(Mips::COPY_TO_REGCLASS,
DL,
1378bool MipsSEDAGToDAGISel::SelectInlineAsmMemoryOperand(
1380 std::vector<SDValue> &OutOps) {
1383 switch(ConstraintID) {
1390 OutOps.push_back(
Base);
1391 OutOps.push_back(
Offset);
1394 OutOps.push_back(
Op);
1395 OutOps.push_back(
CurDAG->getTargetConstant(0, SDLoc(
Op), MVT::i32));
1404 OutOps.push_back(
Base);
1405 OutOps.push_back(
Offset);
1408 OutOps.push_back(
Op);
1409 OutOps.push_back(
CurDAG->getTargetConstant(0, SDLoc(
Op), MVT::i32));
1417 OutOps.push_back(
Base);
1418 OutOps.push_back(
Offset);
1424 OutOps.push_back(
Base);
1425 OutOps.push_back(
Offset);
1431 OutOps.push_back(
Base);
1432 OutOps.push_back(
Offset);
1436 OutOps.push_back(
Op);
1437 OutOps.push_back(
CurDAG->getTargetConstant(0, SDLoc(
Op), MVT::i32));
const AArch64Subtarget & Subtarget
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static uint64_t getConstant(const Value *IndexValue)
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
MachineRegisterInfo & MRI
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 and target specific virtual registers.
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)
MipsSEISelDAGPass(MipsTargetMachine &TM, CodeGenOptLevel OptLevel)
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.
SelectionDAGISelPass(std::unique_ptr< SelectionDAGISel > Selector)
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
LLVM_NO_SANITIZE_CFI_UNRELATED_CAST iterator begin()
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,...
constexpr MCPhysReg RA_64
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.
FunctionPass * createMipsSEISelDAGLegacyPass(MipsTargetMachine &TM, CodeGenOptLevel OptLevel)
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
@ Off
Use window algorithm after SMS algorithm fails.
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.
Align commonAlignment(Align A, uint64_t Offset)
Returns the alignment that satisfies both alignments.
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.
static constexpr Align fromLog2(unsigned Log2Value)
Returns an alignment of 1 << Log2Value bytes.
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.