44 #include "llvm/IR/IntrinsicsHexagon.h" 66 #define DEBUG_TYPE "hexagon-lowering" 70 cl::desc(
"Control jump table emission on Hexagon target"));
74 cl::desc(
"Enable Hexagon SDNode scheduling"));
78 cl::desc(
"Enable Fast Math processing"));
82 cl::desc(
"Set minimum jump tables"));
86 cl::desc(
"Max #stores to inline memcpy"));
90 cl::desc(
"Max #stores to inline memcpy"));
94 cl::desc(
"Max #stores to inline memmove"));
98 cl::desc(
"Max #stores to inline memmove"));
102 cl::desc(
"Max #stores to inline memset"));
106 cl::desc(
"Max #stores to inline memset"));
110 cl::desc(
"Rewrite unaligned loads as a pair of aligned loads"));
115 class HexagonCCState :
public CCState {
116 unsigned NumNamedVarArgParams = 0;
121 unsigned NumNamedArgs)
122 :
CCState(CC, IsVarArg, MF, locs, C),
123 NumNamedVarArgParams(NumNamedArgs) {}
124 unsigned getNumNamedVarArgParams()
const {
return NumNamedVarArgParams; }
143 if (RegNum != NumArgRegs && RegNum % 2 == 1)
152 #include "HexagonGenCallingConv.inc" 182 CCState CCInfo(CallConv, IsVarArg, MF, RVLocs, Context);
185 return CCInfo.
CheckReturn(Outs, RetCC_Hexagon_HVX);
206 if (Subtarget.useHVXOps())
209 CCInfo.AnalyzeReturn(Outs, RetCC_Hexagon);
215 for (
unsigned i = 0; i != RVLocs.
size(); ++i) {
243 .Case(
"r0", Hexagon::R0)
244 .
Case(
"r1", Hexagon::R1)
246 .
Case(
"r3", Hexagon::R3)
248 .
Case(
"r5", Hexagon::R5)
250 .
Case(
"r7", Hexagon::R7)
251 .
Case(
"r8", Hexagon::R8)
252 .
Case(
"r9", Hexagon::R9)
253 .
Case(
"r10", Hexagon::R10)
254 .
Case(
"r11", Hexagon::R11)
255 .
Case(
"r12", Hexagon::R12)
256 .
Case(
"r13", Hexagon::R13)
257 .
Case(
"r14", Hexagon::R14)
258 .
Case(
"r15", Hexagon::R15)
259 .
Case(
"r16", Hexagon::R16)
260 .
Case(
"r17", Hexagon::R17)
261 .
Case(
"r18", Hexagon::R18)
262 .
Case(
"r19", Hexagon::R19)
263 .
Case(
"r20", Hexagon::R20)
264 .
Case(
"r21", Hexagon::R21)
265 .
Case(
"r22", Hexagon::R22)
266 .
Case(
"r23", Hexagon::R23)
267 .
Case(
"r24", Hexagon::R24)
268 .
Case(
"r25", Hexagon::R25)
269 .
Case(
"r26", Hexagon::R26)
270 .
Case(
"r27", Hexagon::R27)
271 .
Case(
"r28", Hexagon::R28)
272 .
Case(
"r29", Hexagon::R29)
273 .
Case(
"r30", Hexagon::R30)
274 .
Case(
"r31", Hexagon::R31)
275 .
Case(
"r1:0", Hexagon::D0)
276 .
Case(
"r3:2", Hexagon::D1)
277 .
Case(
"r5:4", Hexagon::D2)
278 .
Case(
"r7:6", Hexagon::D3)
279 .
Case(
"r9:8", Hexagon::D4)
280 .
Case(
"r11:10", Hexagon::D5)
281 .
Case(
"r13:12", Hexagon::D6)
282 .
Case(
"r15:14", Hexagon::D7)
283 .
Case(
"r17:16", Hexagon::D8)
284 .
Case(
"r19:18", Hexagon::D9)
285 .
Case(
"r21:20", Hexagon::D10)
286 .
Case(
"r23:22", Hexagon::D11)
287 .
Case(
"r25:24", Hexagon::D12)
288 .
Case(
"r27:26", Hexagon::D13)
289 .
Case(
"r29:28", Hexagon::D14)
290 .
Case(
"r31:30", Hexagon::D15)
291 .
Case(
"sp", Hexagon::R29)
292 .
Case(
"fp", Hexagon::R30)
293 .
Case(
"lr", Hexagon::R31)
294 .
Case(
"p0", Hexagon::P0)
295 .
Case(
"p1", Hexagon::P1)
296 .
Case(
"p2", Hexagon::P2)
297 .
Case(
"p3", Hexagon::P3)
298 .
Case(
"sa0", Hexagon::SA0)
299 .
Case(
"lc0", Hexagon::LC0)
300 .
Case(
"sa1", Hexagon::SA1)
301 .
Case(
"lc1", Hexagon::LC1)
302 .
Case(
"m0", Hexagon::M0)
303 .
Case(
"m1", Hexagon::M1)
304 .
Case(
"usr", Hexagon::USR)
305 .
Case(
"ugp", Hexagon::UGP)
329 if (Subtarget.useHVXOps())
332 CCInfo.AnalyzeCallResult(Ins, RetCC_Hexagon);
335 for (
unsigned i = 0; i != RVLocs.
size(); ++i) {
337 if (RVLocs[i].getValVT() ==
MVT::i1) {
347 Register PredR =
MRI.createVirtualRegister(&Hexagon::PredRegsRegClass);
359 RVLocs[i].getValVT(), Glue);
385 bool IsStructRet = Outs.
empty() ?
false : Outs[0].Flags.isSRet();
398 HexagonCCState CCInfo(CallConv, IsVarArg, MF, ArgLocs, *DAG.
getContext(),
401 if (Subtarget.useHVXOps())
402 CCInfo.AnalyzeCallOperands(Outs, CC_Hexagon_HVX);
404 CCInfo.AnalyzeCallOperands(Outs, CC_Hexagon);
408 CLI.
IsTailCall = IsEligibleForTailCallOptimization(Callee, CallConv,
409 IsVarArg, IsStructRet, StructAttrFlag, Outs,
411 for (
unsigned i = 0,
e = ArgLocs.
size(); i !=
e; ++i) {
419 :
"Argument must be passed on stack. " 420 "Not eligible for Tail Call\n"));
423 unsigned NumBytes = CCInfo.getNextStackOffset();
431 bool NeedsArgAlign =
false;
432 unsigned LargestAlignSeen = 0;
434 for (
unsigned i = 0,
e = ArgLocs.
size(); i !=
e; ++i) {
439 bool ArgAlign = Subtarget.isHVXVectorType(VA.
getValVT());
440 NeedsArgAlign |= ArgAlign;
469 LargestAlignSeen =
std::max(LargestAlignSeen,
491 if (NeedsArgAlign && Subtarget.hasV60Ops()) {
492 LLVM_DEBUG(
dbgs() <<
"Function needs byte stack align due to call args\n");
493 unsigned VecAlign = HRI.getSpillAlignment(Hexagon::HvxVRRegClass);
494 LargestAlignSeen =
std::max(LargestAlignSeen, VecAlign);
499 if (!MemOpChains.
empty())
513 for (
unsigned i = 0,
e = RegsToPass.
size(); i !=
e; ++i) {
515 RegsToPass[i].
second, Glue);
530 for (
unsigned i = 0,
e = RegsToPass.
size(); i !=
e; ++i) {
532 RegsToPass[i].
second, Glue);
547 dyn_cast<ExternalSymbolSDNode>(Callee)) {
559 for (
unsigned i = 0,
e = RegsToPass.
size(); i !=
e; ++i) {
561 RegsToPass[i].second.getValueType()));
565 assert(Mask &&
"Missing call preserved mask for calling convention");
582 Chain = DAG.
getNode(OpCode, dl, NodeTys, Ops);
593 InVals, OutVals, Callee);
620 if (!isa<ConstantSDNode>(Offset.
getNode()))
624 int32_t V = cast<ConstantSDNode>(Offset.
getNode())->getSExtValue();
625 return Subtarget.getInstrInfo()->isValidAutoIncImm(VT, V);
644 unsigned Flags = cast<ConstantSDNode>(Op.
getOperand(i))->getZExtValue();
659 for (; NumVals; --NumVals, ++i) {
663 HMFI.setHasClobberLR(
true);
703 unsigned IntNo = cast<ConstantSDNode>(Op.
getOperand(1))->getZExtValue();
705 if (IntNo == Intrinsic::hexagon_prefetch) {
723 assert(AlignConst &&
"Non-constant Align in LowerDYNAMIC_STACKALLOC");
726 auto &HFI = *Subtarget.getFrameLowering();
729 A = HFI.getStackAlignment();
732 dbgs () << __func__ <<
" Align: " << A <<
" Size: ";
755 HexagonCCState CCInfo(CallConv, IsVarArg, MF, ArgLocs, *DAG.
getContext(),
758 if (Subtarget.useHVXOps())
759 CCInfo.AnalyzeFormalArguments(Ins, CC_Hexagon_HVX);
761 CCInfo.AnalyzeFormalArguments(Ins, CC_Hexagon);
772 for (
unsigned i = 0,
e = ArgLocs.
size(); i !=
e; ++i) {
808 assert(RegSize == 32 || RegSize == 64 ||
809 Subtarget.isHVXVectorType(RegVT));
819 unsigned ObjSize = Flags.
isByVal()
846 HMFI.setVarArgsFrameIndex(FI);
889 auto isSExtFree = [
this](
SDValue N) {
890 switch (
N.getOpcode()) {
897 unsigned ThisBW = ty(
N).getSizeInBits();
902 return ThisBW >= OrigBW;
914 if (IsNegative || isSExtFree(LHS) || isSExtFree(RHS))
956 "conversion only supported for pow2 VectorSize!");
958 for (
unsigned i = 0; i < NumVectorElements / 8; ++i) {
960 for (
unsigned j = 0; j < 8; ++j) {
961 uint8_t y = CV->
getOperand(i * 8 + j)->getUniqueInteger().getZExtValue();
964 assert((x == 0 || x == 255) &&
"Either all 0's or all 1's expected!");
975 bool isVTi1Type =
false;
977 Type *CValTy = ConstVal->getType();
981 isVTi1Type = (CVal !=
nullptr);
985 bool IsPositionIndependent = isPositionIndependent();
998 assert(cast<ConstantPoolSDNode>(T)->getTargetFlags() == TF &&
999 "Inconsistent target flag encountered");
1001 if (IsPositionIndependent)
1009 int Idx = cast<JumpTableSDNode>(
Op)->getIndex();
1010 if (isPositionIndependent()) {
1026 if (verifyReturnAddressArgumentIsConstant(Op, DAG))
1031 unsigned Depth = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
1053 unsigned Depth = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
1071 auto *GAN = cast<GlobalAddressSDNode>(
Op);
1073 auto *GV = GAN->getGlobal();
1074 int64_t
Offset = GAN->getOffset();
1076 auto &HLOF = *HTM.getObjFileLowering();
1082 if (GO && Subtarget.useSmallData() && HLOF.isGlobalInSmallSection(GO, HTM))
1087 bool UsePCRel = getTargetMachine().shouldAssumeDSOLocal(*GV->getParent(), GV);
1104 const BlockAddress *BA = cast<BlockAddressSDNode>(
Op)->getBlockAddress();
1147 const auto &HRI = *Subtarget.getRegisterInfo();
1149 assert(Mask &&
"Missing call preserved mask for calling convention");
1174 bool IsPositionIndependent = isPositionIndependent();
1184 if (IsPositionIndependent) {
1186 SDValue GOT = LowerGLOBAL_OFFSET_TABLE(Sym, DAG);
1240 SDValue GOT = LowerGLOBAL_OFFSET_TABLE(TGA, DAG);
1256 return GetDynamicTLSAddr(DAG, Chain, GA, InFlag, PtrVT,
1257 Hexagon::R0, Flags);
1270 switch (HTM.getTLSModel(GA->
getGlobal())) {
1273 return LowerToTLSGeneralDynamicModel(GA, DAG);
1275 return LowerToTLSInitialExecModel(GA, DAG);
1277 return LowerToTLSLocalExecModel(GA, DAG);
1427 for (
unsigned IntExpOp :
1436 for (
unsigned FPExpOp :
1472 static const unsigned VectExpOps[] = {
1497 for (
unsigned VectExpOp : VectExpOps)
1511 if (VT.getVectorElementType() !=
MVT::i32) {
1628 initializeHVXLowering();
1648 setLibcallName(RTLIB::FPTOUINT_F32_I128,
"__hexagon_fixunssfti");
1649 setLibcallName(RTLIB::FPTOUINT_F64_I128,
"__hexagon_fixunsdfti");
1736 HexagonTargetLowering::validateConstPtrAlignment(
SDValue Ptr,
const SDLoc &dl,
1737 unsigned NeedAlign)
const {
1743 if (HaveAlign < NeedAlign) {
1746 O <<
"Misaligned constant address: " <<
format_hex(Addr, 10)
1747 <<
" has alignment " << HaveAlign
1748 <<
", but the memory access requires " << NeedAlign;
1750 DL.print(O <<
", at ");
1759 return (ID == Intrinsic::hexagon_L2_loadrd_pbr ||
1760 ID == Intrinsic::hexagon_L2_loadri_pbr ||
1761 ID == Intrinsic::hexagon_L2_loadrh_pbr ||
1762 ID == Intrinsic::hexagon_L2_loadruh_pbr ||
1763 ID == Intrinsic::hexagon_L2_loadrb_pbr ||
1764 ID == Intrinsic::hexagon_L2_loadrub_pbr);
1773 V = cast<Operator>(V)->getOperand(0);
1775 V = cast<Instruction>(V)->getOperand(0);
1788 if (Blk == Parent) {
1793 BaseVal = BackEdgeVal;
1795 }
while ((BaseVal != BackEdgeVal) && (IntrBaseVal != BackEdgeVal));
1798 if (IntrBaseVal == BackEdgeVal)
1805 assert(Idx >= 0 &&
"Unexpected index to incoming argument in PHI");
1813 Value *IntrBaseVal = V;
1820 }
while (BaseVal != V);
1823 if (
const PHINode *PN = dyn_cast<PHINode>(V))
1837 unsigned Intrinsic)
const {
1838 switch (Intrinsic) {
1839 case Intrinsic::hexagon_L2_loadrd_pbr:
1840 case Intrinsic::hexagon_L2_loadri_pbr:
1841 case Intrinsic::hexagon_L2_loadrh_pbr:
1842 case Intrinsic::hexagon_L2_loadruh_pbr:
1843 case Intrinsic::hexagon_L2_loadrb_pbr:
1844 case Intrinsic::hexagon_L2_loadrub_pbr: {
1863 case Intrinsic::hexagon_V6_vgathermw:
1864 case Intrinsic::hexagon_V6_vgathermw_128B:
1865 case Intrinsic::hexagon_V6_vgathermh:
1866 case Intrinsic::hexagon_V6_vgathermh_128B:
1867 case Intrinsic::hexagon_V6_vgathermhw:
1868 case Intrinsic::hexagon_V6_vgathermhw_128B:
1869 case Intrinsic::hexagon_V6_vgathermwq:
1870 case Intrinsic::hexagon_V6_vgathermwq_128B:
1871 case Intrinsic::hexagon_V6_vgathermhq:
1872 case Intrinsic::hexagon_V6_vgathermhq_128B:
1873 case Intrinsic::hexagon_V6_vgathermhwq:
1874 case Intrinsic::hexagon_V6_vgathermhwq_128B: {
1915 unsigned DefinedValues)
const {
1939 unsigned HwWidth = 8*HwLen;
1941 if (VecWidth >= HwWidth/2 && VecWidth < HwWidth)
1945 if (ElemTy ==
MVT::i1 && VecLen == 2*HwLen)
1956 std::pair<SDValue, int>
1957 HexagonTargetLowering::getBaseAndOffset(
SDValue Addr)
const {
1960 if (
auto *CN = dyn_cast<const ConstantSDNode>(Op1.
getNode()))
1961 return { Addr.
getOperand(0), CN->getSExtValue() };
1971 const auto *SVN = cast<ShuffleVectorSDNode>(
Op);
1973 assert(AM.size() <= 8 &&
"Unexpected shuffle mask");
1974 unsigned VecLen = AM.size();
1978 "HVX shuffles should be legal");
1983 const SDLoc &dl(Op);
1988 if (ty(Op0) != VecTy || ty(Op1) != VecTy)
1994 unsigned F =
llvm::find_if(AM, [](
int M) {
return M >= 0; }) - AM.data();
1997 if (AM[F] >=
int(VecLen)) {
2005 for (
unsigned i = 0,
e =
Mask.size(); i !=
e; ++i) {
2008 for (
unsigned j = 0; j != ElemBytes; ++j)
2011 for (
unsigned j = 0; j != ElemBytes; ++j)
2022 uint64_t MaskIdx = 0;
2023 uint64_t MaskUnd = 0;
2024 for (
unsigned i = 0,
e = ByteMask.
size(); i !=
e; ++i) {
2026 uint64_t M = ByteMask[i] & 0xFF;
2032 if (ByteMask.
size() == 4) {
2034 if (MaskIdx == (0x03020100 | MaskUnd))
2037 if (MaskIdx == (0x00010203 | MaskUnd)) {
2045 typeJoin({ty(Op1), ty(Op0)}), {Op1, Op0});
2046 if (MaskIdx == (0x06040200 | MaskUnd))
2047 return getInstr(Hexagon::S2_vtrunehb, dl, VecTy, {Concat10}, DAG);
2048 if (MaskIdx == (0x07050301 | MaskUnd))
2049 return getInstr(Hexagon::S2_vtrunohb, dl, VecTy, {Concat10}, DAG);
2052 typeJoin({ty(Op0), ty(Op1)}), {Op0, Op1});
2053 if (MaskIdx == (0x02000604 | MaskUnd))
2054 return getInstr(Hexagon::S2_vtrunehb, dl, VecTy, {Concat01}, DAG);
2055 if (MaskIdx == (0x03010705 | MaskUnd))
2056 return getInstr(Hexagon::S2_vtrunohb, dl, VecTy, {Concat01}, DAG);
2059 if (ByteMask.
size() == 8) {
2061 if (MaskIdx == (0x0706050403020100ull | MaskUnd))
2064 if (MaskIdx == (0x0001020304050607ull | MaskUnd)) {
2071 if (MaskIdx == (0x0d0c050409080100ull | MaskUnd))
2072 return getInstr(Hexagon::S2_shuffeh, dl, VecTy, {Op1, Op0}, DAG);
2073 if (MaskIdx == (0x0f0e07060b0a0302ull | MaskUnd))
2074 return getInstr(Hexagon::S2_shuffoh, dl, VecTy, {Op1, Op0}, DAG);
2075 if (MaskIdx == (0x0d0c090805040100ull | MaskUnd))
2076 return getInstr(Hexagon::S2_vtrunewh, dl, VecTy, {Op1, Op0}, DAG);
2077 if (MaskIdx == (0x0f0e0b0a07060302ull | MaskUnd))
2078 return getInstr(Hexagon::S2_vtrunowh, dl, VecTy, {Op1, Op0}, DAG);
2079 if (MaskIdx == (0x0706030205040100ull | MaskUnd)) {
2080 VectorPair
P = opSplit(Op0, dl, DAG);
2081 return getInstr(Hexagon::S2_packhl, dl, VecTy, {P.second, P.first}, DAG);
2085 if (MaskIdx == (0x0e060c040a020800ull | MaskUnd))
2086 return getInstr(Hexagon::S2_shuffeb, dl, VecTy, {Op1, Op0}, DAG);
2087 if (MaskIdx == (0x0f070d050b030901ull | MaskUnd))
2088 return getInstr(Hexagon::S2_shuffob, dl, VecTy, {Op1, Op0}, DAG);
2099 if (
SDValue S = BVN->getSplatValue()) {
2123 return getVectorShiftByInt(Op, DAG);
2137 MVT InpTy = ty(InpV);
2139 const SDLoc &dl(Op);
2145 return getInstr(Hexagon::C2_tfrrp, dl, ResTy, Ext, DAG);
2158 bool AllConst =
true;
2160 for (
unsigned i = 0,
e = Values.
size(); i !=
e; ++i) {
2167 if (
auto *CN = dyn_cast<ConstantSDNode>(V.
getNode())) {
2168 const ConstantInt *CI = CN->getConstantIntValue();
2170 }
else if (
auto *CN = dyn_cast<ConstantFPSDNode>(V.
getNode())) {
2171 const ConstantFP *CF = CN->getConstantFPValue();
2188 bool AllConst = getBuildVectorConstInts(Elem, VecTy, DAG, Consts);
2190 unsigned First, Num = Elem.
size();
2191 for (First = 0; First != Num; ++First)
2192 if (!isUndef(Elem[First]))
2199 return getZero(dl, VecTy, DAG);
2204 uint32_t V = (Consts[0]->getZExtValue() & 0xFFFF) |
2205 Consts[1]->getZExtValue() << 16;
2209 {Elem[1], Elem[0]}, DAG);
2216 int32_t V = (Consts[0]->getZExtValue() & 0xFF) |
2217 (Consts[1]->getZExtValue() & 0xFF) << 8 |
2218 (Consts[1]->getZExtValue() & 0xFF) << 16 |
2219 Consts[2]->getZExtValue() << 24;
2224 bool IsSplat =
true;
2225 for (
unsigned i = 0; i != Num; ++i) {
2228 if (Elem[i] == Elem[First] || isUndef(Elem[i]))
2244 for (
unsigned i = 0; i != 4; ++i) {
2254 SDValue R = getInstr(Hexagon::A2_combine_ll, dl,
MVT::i32, {B1, B0}, DAG);
2271 bool AllConst = getBuildVectorConstInts(Elem, VecTy, DAG, Consts);
2273 unsigned First, Num = Elem.
size();
2274 for (First = 0; First != Num; ++First)
2275 if (!isUndef(Elem[First]))
2282 return getZero(dl, VecTy, DAG);
2286 bool IsSplat =
true;
2287 for (
unsigned i = 0; i != Num; ++i) {
2290 if (Elem[i] == Elem[First] || isUndef(Elem[i]))
2307 : (ElemTy ==
MVT::i16) ? 0xFFFFull : 0xFFFFFFFFull;
2308 for (
unsigned i = 0; i != Num; ++i)
2309 Val = (Val << W) | (Consts[Num-1-i]->getZExtValue() &
Mask);
2318 : buildVector32(Elem.
take_front(Num/2), dl, HalfTy, DAG);
2321 : buildVector32(Elem.
drop_front(Num/2), dl, HalfTy, DAG);
2329 MVT VecTy = ty(VecV);
2335 assert((VecWidth % ElemWidth) == 0);
2340 if (ElemWidth == 1) {
2342 assert(VecWidth == 8 || VecWidth == 4 || VecWidth == 2);
2353 if (ValWidth == 1) {
2364 unsigned Scale = VecWidth / ValWidth;
2369 unsigned VecRep = 8 / VecWidth;
2378 T1 = expandPredicate(T1, dl, DAG);
2385 assert(VecWidth == 32 || VecWidth == 64);
2388 MVT ScalarTy = tyScalar(VecTy);
2395 unsigned Off = IdxN->getZExtValue() * ElemWidth;
2396 if (VecWidth == 64 && ValWidth == 32) {
2397 assert(Off == 0 || Off == 32);
2398 unsigned SubIdx = Off == 0 ? Hexagon::isub_lo : Hexagon::isub_hi;
2400 }
else if (Off == 0 && (ValWidth % 8) == 0) {
2407 {VecV, WidthV, OffV});
2415 {VecV, WidthV, OffV});
2428 MVT VecTy = ty(VecV);
2430 MVT ValTy = ty(ValV);
2437 for (
unsigned R = Scale; R > 1; R /= 2) {
2438 ValR = contractPredicate(ValR, dl, DAG);
2446 unsigned ValBytes = 64 / Scale;
2452 {VecR, ValR,
Width, Idx});
2458 assert(VecWidth == 32 || VecWidth == 64);
2459 assert((VecWidth % ValWidth) == 0);
2475 unsigned W =
C->getZExtValue() * ValWidth;
2478 {VecV, ValV, WidthV, OffV});
2484 {VecV, ValV, WidthV, OffV});
2491 HexagonTargetLowering::expandPredicate(
SDValue Vec32,
const SDLoc &dl,
2496 return getInstr(Hexagon::S2_vsxtbh, dl,
MVT::i64, {Vec32}, DAG);
2500 HexagonTargetLowering::contractPredicate(
SDValue Vec64,
const SDLoc &dl,
2505 return getInstr(Hexagon::S2_vtrunehb, dl,
MVT::i32, {Vec64}, DAG);
2530 const SDLoc &dl(Op);
2536 return buildVector32(Ops, dl, VecTy, DAG);
2538 return buildVector64(Ops, dl, VecTy, DAG);
2542 bool All0 =
true, All1 =
true;
2545 if (CN ==
nullptr) {
2546 All0 = All1 =
false;
2565 for (
unsigned i = 0; i != 8; ++i) {
2570 for (
unsigned i = 0,
e = A.size()/2; i !=
e; ++i)
2574 return getInstr(Hexagon::C2_tfrrp, dl, VecTy, {Rs[0]}, DAG);
2584 const SDLoc &dl(Op);
2609 for (
unsigned R = Scale; R > 1; R /= 2) {
2610 W = contractPredicate(W, dl, DAG);
2615 Words[IdxW].push_back(W);
2620 Words[IdxW ^ 1].clear();
2622 for (
unsigned i = 0,
e = Words[IdxW].
size(); i !=
e; i += 2) {
2623 SDValue W0 = Words[IdxW][i], W1 = Words[IdxW][i+1];
2626 {W0, W1, WidthV, WidthV});
2627 Words[IdxW ^ 1].push_back(T);
2635 assert(Scale == 2 && Words[IdxW].
size() == 2);
2638 Words[IdxW][1], Words[IdxW][0]);
2650 return extractVector(Vec, Op.
getOperand(1),
SDLoc(Op), ElemTy, ty(Op), DAG);
2657 ty(Op), ty(Op), DAG);
2672 SDLoc(Op), ty(ValV), DAG);
2703 const SDLoc &dl(Op);
2704 validateConstPtrAlignment(Ptr, dl, ClaimAlign);
2708 if (ClaimAlign < NeedAlign)
2717 MVT LoadTy = ty(Op);
2720 if (HaveAlign >= NeedAlign)
2723 const SDLoc &dl(Op);
2729 bool DoDefault =
false;
2740 if (!DoDefault && (2 * HaveAlign) == NeedAlign) {
2757 assert(LoadTy.getSizeInBits() == 8*NeedAlign);
2759 unsigned LoadLen = NeedAlign;
2762 auto BO = getBaseAndOffset(Base);
2763 unsigned BaseOpc = BO.first.getOpcode();
2767 if (BO.second % LoadLen != 0) {
2770 BO.second -= BO.second % LoadLen;
2783 2*LoadLen, LoadLen, MMO->getAAInfo(), MMO->getRanges(),
2784 MMO->getSyncScopeID(), MMO->getOrdering(),
2785 MMO->getFailureOrdering());
2806 const SDLoc &dl(Op);
2814 assert(VY != 0 &&
"This should have been folded");
2838 const SDLoc &dl(Op);
2846 EVT CarryTy =
C.getValueType();
2867 unsigned OffsetReg = Hexagon::R28;
2873 Chain = DAG.
getCopyToReg(Chain, dl, OffsetReg, Offset);
2889 if (isHvxOperation(Op)) {
2891 if (
SDValue V = LowerHvxOperation(Op, DAG))
2900 errs() <<
"Error: check for a non-legal type in this operation\n";
2984 if (isHvxOperation(Op)) {
2985 if (
SDValue V = PerformHvxDAGCombine(N, DCI))
2990 const SDLoc &dl(Op);
2999 return getZero(dl, ty(Op), DCI.
DAG);
3025 int Idx = cast<JumpTableSDNode>(Table)->getIndex();
3037 if (Constraint.
size() == 1) {
3038 switch (Constraint[0]) {
3053 std::pair<unsigned, const TargetRegisterClass*>
3057 if (Constraint.
size() == 1) {
3058 switch (Constraint[0]) {
3062 return {0u,
nullptr};
3068 return {0u, &Hexagon::IntRegsRegClass};
3071 return {0u, &Hexagon::DoubleRegsRegClass};
3076 return {0u,
nullptr};
3077 return {0u, &Hexagon::ModRegsRegClass};
3081 return {0u,
nullptr};
3084 return {0u, &Hexagon::HvxQRRegClass};
3090 return {0u,
nullptr};
3092 return {0u, &Hexagon::HvxVRRegClass};
3095 return {0u, &Hexagon::HvxVRRegClass};
3096 return {0u, &Hexagon::HvxWRRegClass};
3098 return {0u, &Hexagon::HvxWRRegClass};
3102 return {0u,
nullptr};
3113 bool ForCodeSize)
const {
3143 int Scale = AM.
Scale;
3167 return Imm >= -512 && Imm <= 511;
3177 bool IsCalleeStructRet,
3178 bool IsCallerStructRet,
3185 bool CCMatch = CallerCC == CalleeCC;
3193 if (!isa<GlobalAddressSDNode>(Callee) &&
3194 !isa<ExternalSymbolSDNode>(Callee)) {
3214 if (IsCalleeStructRet || IsCallerStructRet)
3236 unsigned DstAlign,
unsigned SrcAlign,
bool IsMemset,
bool ZeroMemset,
3237 bool MemcpyStrSrc,
const AttributeList &FuncAttributes)
const {
3239 auto Aligned = [](
unsigned GivenA,
unsigned MinA) ->
bool {
3240 return (GivenA % MinA) == 0;
3243 if (Size >= 8 && Aligned(DstAlign, 8) && (IsMemset || Aligned(SrcAlign, 8)))
3245 if (Size >= 4 && Aligned(DstAlign, 4) && (IsMemset || Aligned(SrcAlign, 4)))
3247 if (Size >= 2 && Aligned(DstAlign, 2) && (IsMemset || Aligned(SrcAlign, 2)))
3261 std::pair<const TargetRegisterClass*, uint8_t>
3269 return std::make_pair(&Hexagon::HvxQRRegClass, 1);
3270 if (BitWidth == VecWidth)
3271 return std::make_pair(&Hexagon::HvxVRRegClass, 1);
3272 assert(BitWidth == 2 * VecWidth);
3273 return std::make_pair(&Hexagon::HvxWRRegClass, 1);
3285 auto *L = cast<LoadSDNode>(
Load);
3286 std::pair<SDValue,int> BO = getBaseAndOffset(L->getBasePtr());
3292 const auto *GO = dyn_cast_or_null<const GlobalObject>(GA->getGlobal());
3302 auto PT = cast<PointerType>(Addr->
getType());
3303 Type *Ty = PT->getElementType();
3304 unsigned SZ = Ty->getPrimitiveSizeInBits();
3305 assert((SZ == 32 || SZ == 64) &&
"Only 32/64-bit atomic loads supported");
3306 Intrinsic::ID IntID = (SZ == 32) ? Intrinsic::hexagon_L2_loadw_locked
3307 : Intrinsic::hexagon_L4_loadd_locked;
3329 assert((SZ == 32 || SZ == 64) &&
"Only 32/64-bit atomic stores supported");
3330 Intrinsic::ID IntID = (SZ == 32) ? Intrinsic::hexagon_S2_storew_locked
3331 : Intrinsic::hexagon_S4_stored_locked;
3362 if (Size >= 4 && Size <= 8)
virtual std::pair< const TargetRegisterClass *, uint8_t > findRepresentativeClass(const TargetRegisterInfo *TRI, MVT VT) const
Return the largest legal super-reg register class of the register class for the specified type and it...
SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
bool isMachineConstantPoolEntry() const
bool isGlobalInSmallSection(const GlobalObject *GO, const TargetMachine &TM) const
Return true if this global value should be placed into small data/bss section.
Type * getVectorElementType() const
void setFrameAddressIsTaken(bool T)
SDValue LowerINSERT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
Value * getValueOperand()
unsigned getFirstUnallocated(ArrayRef< MCPhysReg > Regs) const
getFirstUnallocated - Return the index of the first unallocated register in the set, or Regs.size() if they are all allocated.
static MVT getIntegerVT(unsigned BitWidth)
void AnalyzeCallResult(const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
AnalyzeCallResult - Analyze the return values of a call, incorporating info about the passed values i...
static SDValue LowerCallResult(SDValue Chain, SDValue InFlag, const SmallVectorImpl< CCValAssign > &RVLocs, const SDLoc &dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals)
LowerCallResult - Lower the result values of a call into the appropriate copies out of appropriate ph...
A parsed version of the target data layout string in and methods for querying it. ...
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
bool useHVX128BOps() const
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
EVT getValueType() const
Return the ValueType of the referenced return value.
This represents an addressing mode of: BaseGV + BaseOffs + BaseReg + Scale*ScaleReg If BaseGV is null...
bool isInteger() const
Return true if this is an integer or a vector integer type.
SDValue LowerAddSubCarry(SDValue Op, SelectionDAG &DAG) const
static void commuteMask(MutableArrayRef< int > Mask)
Change values in a shuffle permute mask assuming the two vector operands have swapped position...
bool getTgtMemIntrinsic(IntrinsicInfo &Info, const CallInst &I, MachineFunction &MF, unsigned Intrinsic) const override
Given an intrinsic, checks if on the target the intrinsic will need to map to a MemIntrinsicNode (tou...
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
void setLoadExtAction(unsigned ExtType, MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified load with extension does not work with the specified type and indicate wh...
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
SDValue LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const
const GlobalValue * getGlobal() const
uint64_t getZExtValue() const
Get zero extended value.
ArrayRef< T > take_front(size_t N=1) const
Return a copy of *this with only the first N elements.
std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const override
Given a physical register constraint (e.g.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
void setMinimumJumpTableEntries(unsigned Val)
Indicate the minimum number of blocks to generate jump tables.
static bool CC_SkipOdd(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2, SDValue InGlue, const SDLoc &DL)
Return a new CALLSEQ_END node, which always must have a glue result (to ensure it's not CSE'd)...
bool isLegalICmpImmediate(int64_t Imm) const override
isLegalICmpImmediate - Return true if the specified immediate is legal icmp immediate, that is the target has icmp instructions which can compare a register against the immediate without having to materialize the immediate into a register.
ConstraintType getConstraintType(StringRef Constraint) const override
Given a constraint, return the type of constraint it is for this target.
EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an vector value) starting with the ...
BR_CC - Conditional branch.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
Register getLocReg() const
static MVT getVectorVT(MVT VT, unsigned NumElements)
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
void setHasEHReturn(bool H=true)
A Module instance is used to store all the information related to an LLVM module. ...
bool isSized(SmallPtrSetImpl< Type *> *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
An instruction that atomically checks whether a specified value is in a memory location, and, if it is, stores a new value there.
HexagonTargetObjectFile * getObjFileLowering() const override
FormattedNumber format_hex(uint64_t N, unsigned Width, bool Upper=false)
format_hex - Output N as a fixed width hexadecimal.
bool isVector() const
Return true if this is a vector value type.
unsigned getSizeInBits(Register Reg, const MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI) const
Get the size in bits of Reg.
bool getPostIndexedAddressParts(SDNode *N, SDNode *Op, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, SelectionDAG &DAG) const override
Returns true by value, base pointer and offset pointer and addressing mode by reference if this node ...
void addLiveIn(unsigned Reg, unsigned vreg=0)
addLiveIn - Add the specified register as a live-in.
const SDValue & getBasePtr() const
static cl::opt< bool > EmitJumpTables("hexagon-emit-jump-tables", cl::init(true), cl::Hidden, cl::desc("Control jump table emission on Hexagon target"))
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
void push_back(const T &Elt)
unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC)
addLiveIn - Add the specified physical register as a live-in value and create a corresponding virtual...
SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
MachineMemOperand::Flags flags
bool isScalarInteger() const
Return true if this is an integer, but not a vector.
STACKRESTORE has two operands, an input chain and a pointer to restore to it returns an output chain...
SDVTList getVTList() const
This class represents a function call, abstracting a target machine's calling convention.
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned TargetFlags=0)
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
unsigned getVectorNumElements() const
ArrayRef< MVT > getHVXElementTypes() const
const SDValue & getChain() const
void ensureMaxAlignment(Align Alignment)
Make sure the function is at least Align bytes aligned.
Function Alias Analysis Results
LLVMContext & getContext() const
All values hold a context through their type.
unsigned getAlignment() const
SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const
void LowerOperationWrapper(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
This callback is invoked by the type legalizer to legalize nodes with an illegal operand type but leg...
virtual std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const
Given a physical register constraint (e.g.
Hexagon target-specific information for each MachineFunction.
SDValue LowerVSELECT(SDValue Op, SelectionDAG &DAG) const
void setBooleanVectorContents(BooleanContent Ty)
Specify how the target extends the result of a vector boolean value from a vector of i1 to a wider ty...
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly...
C - The default llvm calling convention, compatible with C.
void ReplaceNodeResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
This callback is invoked when a node result type is illegal for the target, and the operation was reg...
unsigned const TargetRegisterInfo * TRI
SDValue LowerATOMIC_FENCE(SDValue Op, SelectionDAG &DAG) const
Type * getStructElementType(unsigned N) const
SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS, SDValue RHS)
Helper function to make it easier to build Select's if you just have operands and don't want to check...
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
SDValue LowerEXTRACT_SUBVECTOR(SDValue Op, SelectionDAG &DAG) const
An instruction for reading from memory.
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
bool isVectorTy() const
True if this is an instance of VectorType.
AtomicExpansionKind shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *AI) const override
Returns how the given atomic cmpxchg should be expanded by the IR-level AtomicExpand pass...
AtomicExpansionKind
Enum that specifies what an atomic load/AtomicRMWInst is expanded to, if at all.
bool isOperationLegalOrCustom(unsigned Op, EVT VT) const
Return true if the specified operation is legal on this target or can be made legal with custom lower...
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector with VECTOR2 inserted into VECTOR1 at the ...
unsigned getStackRegister() const
OUTCHAIN = ATOMIC_FENCE(INCHAIN, ordering, scope) This corresponds to the fence instruction.
#define HEXAGON_LRFP_SIZE
SDValue LowerToTLSLocalExecModel(GlobalAddressSDNode *GA, SelectionDAG &DAG) const
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
StringSwitch & Case(StringLiteral S, T Value)
FunctionType * getFunctionType() const
void setTruncStoreAction(MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified truncating store does not work with the specified type and indicate what ...
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
bool hasStructRetAttr() const
Determine if the function returns a structure through first or second pointer argument.
bool isFPImmLegal(const APFloat &Imm, EVT VT, bool ForCodeSize) const override
isFPImmLegal - Returns true if the target can instruction select the specified FP immediate natively...
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
Value * getArgOperand(unsigned i) const
unsigned countTrailingZeros(T Val, ZeroBehavior ZB=ZB_Width)
Count number of 0's from the least significant bit to the most stopping at the first 1...
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
The address of a basic block.
A description of a memory reference used in the backend.
void setMaxAtomicSizeInBitsSupported(unsigned SizeInBits)
Set the maximum atomic operation size supported by the backend.
static Value * returnEdge(const PHINode *PN, Value *IntrBaseVal)
Value * emitStoreConditional(IRBuilder<> &Builder, Value *Val, Value *Addr, AtomicOrdering Ord) const override
Perform a store-conditional operation to Addr.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const
Register getFrameRegister(const MachineFunction &MF) const override
Shift and rotation operations.
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
LLVMContext & getContext() const
Get the global data context.
Base class for LoadSDNode and StoreSDNode.
bool shouldExpandBuildVectorWithShuffles(EVT VT, unsigned DefinedValues) const override
ABS - Determine the unsigned absolute value of a signed integer value of the same bitwidth...
SDValue getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT, SDValue Operand)
A convenience function for creating TargetInstrInfo::EXTRACT_SUBREG nodes.
PointerType * getPointerTo(unsigned AddrSpace=0) const
Return a pointer to the current type.
const HexagonRegisterInfo * getRegisterInfo() const override
BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool isIntegerTy() const
True if this is an instance of IntegerType.
SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const
bool isFMAFasterThanFMulAndFAdd(const MachineFunction &, EVT) const override
Return true if an FMA operation is faster than a pair of mul and add instructions.
static Value * getUnderLyingObjectForBrevLdIntr(Value *V)
SDValue LowerEH_RETURN(SDValue Op, SelectionDAG &DAG) const
LLVM_NODISCARD R Default(T Value)
SDValue getTargetJumpTable(int JTI, EVT VT, unsigned TargetFlags=0)
void setCondCodeAction(ISD::CondCode CC, MVT VT, LegalizeAction Action)
Indicate that the specified condition code is or isn't supported on the target and indicate what to d...
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
void setOperationAction(unsigned Op, MVT VT, LegalizeAction Action)
Indicate that the specified operation does not work with the specified type and indicate what to do a...
const DataLayout & getDataLayout() const
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and llvm.returnaddress on the DAG...
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, unsigned base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
LocInfo getLocInfo() const
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
This file implements a class to represent arbitrary precision integral constant values and operations...
INLINEASM - Represents an inline asm block.
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
bool isShuffleMaskLegal(ArrayRef< int > Mask, EVT VT) const override
Targets can use this to indicate that they only support some VECTOR_SHUFFLE operations, those with specific masks.
SmallVector< ISD::InputArg, 32 > Ins
AtomicOrdering
Atomic ordering for LLVM's memory model.
STACKSAVE - STACKSAVE has one operand, an input chain.
SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
InstrTy * getInstruction() const
int64_t getSExtValue() const
SDValue getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either sign-extending or trunca...
static Value * getBrevLdObject(Value *V)
Value * CreateBitCast(Value *V, Type *DestTy, const Twine &Name="")
int64_t getSExtValue() const
Get sign extended value.
Type * getType() const
All values are typed, get the type of this value.
MachineFunction & getMachineFunction() const
void computeRegisterProperties(const TargetRegisterInfo *TRI)
Once all of the register classes are added, this allows us to compute derived properties we expose...
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
TypeSize getTypeStoreSize(Type *Ty) const
Returns the maximum number of bytes that may be overwritten by storing the specified type...
SDValue getRegisterMask(const uint32_t *RegMask)
SDValue LowerVECTOR_SHIFT(SDValue Op, SelectionDAG &DAG) const
BasicBlock * GetInsertBlock() const
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
void setMinFunctionAlignment(Align Alignment)
Set the target's minimum function alignment.
Simple integer binary arithmetic operators.
TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const override
Return the preferred vector type legalization action.
SmallVector< ISD::OutputArg, 32 > Outs
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond, SDValue Chain=SDValue(), bool IsSignaling=false)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
LLVM_NODISCARD size_t size() const
size - Get the string size.
const APInt & getValue() const
Return the constant as an APInt value reference.
SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
Reloc::Model getRelocationModel() const
Returns the code generation relocation model.
An instruction for storing to memory.
bool mayBeEmittedAsTailCall(const CallInst *CI) const override
Return true if the target may be able emit the call instruction as a tail call.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
std::pair< SDValue, SDValue > expandUnalignedLoad(LoadSDNode *LD, SelectionDAG &DAG) const
Expands an unaligned load to 2 half-size loads for an integer, and possibly more for vectors...
Value * CreateZExt(Value *V, Type *DestTy, const Twine &Name="")
READCYCLECOUNTER - This corresponds to the readcyclecounter intrinsic.
void setMinCmpXchgSizeInBits(unsigned SizeInBits)
Sets the minimum cmpxchg or ll/sc size supported by the backend.
bool allowTruncateForTailCall(Type *Ty1, Type *Ty2) const override
Return true if a truncation from FromTy to ToTy is permitted when deciding whether a call is in tail ...
static cl::opt< int > MinimumJumpTables("minimum-jump-tables", cl::Hidden, cl::ZeroOrMore, cl::init(5), cl::desc("Set minimum jump tables"))
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
Function * getDeclaration(Module *M, ID id, ArrayRef< Type *> Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
MVT getVectorElementType() const
SDValue LowerToTLSInitialExecModel(GlobalAddressSDNode *GA, SelectionDAG &DAG) const
Value * getOperand(unsigned i) const
Analysis containing CSE Info
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
Class to represent pointers.
unsigned getByValSize() const
This class is used to represent ISD::STORE nodes.
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS, Instruction *I=nullptr) const override
isLegalAddressingMode - Return true if the addressing mode represented by AM is legal for this target...
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
void setPrefFunctionAlignment(Align Alignment)
Set the target's preferred function alignment.
bool isScalableVector() const
Return true if this is a vector value type where the runtime length is machine dependent.
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...
The memory access is volatile.
void setPrefLoopAlignment(Align Alignment)
Set the target's preferred loop alignment.
SDValue LowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const
bool isNegative() const
Determine sign of this APInt.
const SDValue & getBasePtr() const
A switch()-like statement whose cases are string literals.
initializer< Ty > init(const Ty &Val)
Type * getReturnType() const
Returns the type of the ret val.
int64_t getOffset() const
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
unsigned const MachineRegisterInfo * MRI
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
LLVM Basic Block Representation.
TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
The instances of the Type class are immutable: once they are created, they are never changed...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
This is an important class for using LLVM in a threaded context.
void addRegisterClass(MVT VT, const TargetRegisterClass *RC)
Add the specified register class as an available regclass for the specified value type...
virtual ConstraintType getConstraintType(StringRef Constraint) const
Given a constraint, return the type of constraint it is for this target.
Simple binary floating point operators.
void setTargetDAGCombine(ISD::NodeType NT)
Targets should invoke this method for each target independent node that they want to provide a custom...
static bool isBrevLdIntrinsic(const Value *Inst)
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
size_t size() const
size - Get the array size.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This is an important base class in LLVM.
VAEND, VASTART - VAEND and VASTART have three operands: an input chain, pointer, and a SRCVALUE...
iterator_range< value_op_iterator > op_values() const
Value * getCompareOperand()
const SDValue & getOperand(unsigned Num) const
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
static cl::opt< int > MaxStoresPerMemmoveOptSizeCL("max-store-memmove-Os", cl::Hidden, cl::ZeroOrMore, cl::init(4), cl::desc("Max #stores to inline memmove"))
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL...
bool shouldExpandAtomicStoreInIR(StoreInst *SI) const override
Returns true if the given (atomic) store should be expanded by the IR-level AtomicExpand pass into an...
SDValue LowerToTLSGeneralDynamicModel(GlobalAddressSDNode *GA, SelectionDAG &DAG) const
OperandFlags
These are flags set on operands, but should be considered private, all access should go through the M...
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
ConstantFP - Floating Point Values [float, double].
SDValue getCALLSEQ_START(SDValue Chain, uint64_t InSize, uint64_t OutSize, const SDLoc &DL)
Return a new CALLSEQ_START node, that starts new call frame, in which InSize bytes are set up inside ...
void setBooleanContents(BooleanContent Ty)
Specify how the target extends the result of integer and floating point boolean values from i1 to a w...
bool isScalarInteger() const
Return true if this is an integer, not including vectors.
bool isTruncateFree(Type *Ty1, Type *Ty2) const override
Return true if it's free to truncate a value of type FromTy to type ToTy.
#define HEXAGON_GOT_SYM_NAME
static mvt_range fp_valuetypes()
static unsigned getNumOperandRegisters(unsigned Flag)
getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag...
SDValue LowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const
static SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget)
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
static cl::opt< bool > AlignLoads("hexagon-align-loads", cl::Hidden, cl::init(false), cl::desc("Rewrite unaligned loads as a pair of aligned loads"))
TRAP - Trapping instruction.
const APInt & getAPIntValue() const
static unsigned getKind(unsigned Flags)
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
std::string getEVTString() const
This function returns value type as a string, e.g. "i32".
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
Value * CreateICmpEQ(Value *LHS, Value *RHS, const Twine &Name="")
Class to represent integer types.
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
Constant Vector Declarations.
VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE, and the alignment.
auto find_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
IntegerType * getIntNTy(unsigned N)
Fetch the type representing an N-bit integer.
void AddPromotedToType(unsigned Opc, MVT OrigVT, MVT DestVT)
If Opc/OrigVT is specified as being promoted, the promotion code defaults to trying a larger integer/...
unsigned MaxStoresPerMemmove
Specify maximum number of store instructions per memmove call.
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...
EVT getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign, bool IsMemset, bool ZeroMemset, bool MemcpyStrSrc, const AttributeList &FuncAttributes) const override
Returns the target specific optimal type for load and store operations as a result of memset...
unsigned getAlignment() const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
This structure contains all information that is necessary for lowering calls.
Value * getIncomingValue(unsigned i) const
Return incoming value number x.
static SDValue CreateCopyOfByValArgument(SDValue Src, SDValue Dst, SDValue Chain, ISD::ArgFlagsTy Flags, SelectionDAG &DAG, const SDLoc &dl)
CreateCopyOfByValArgument - Make a copy of an aggregate at address specified by "Src" to address "Dst...
auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
const TargetMachine & getTargetMachine() const
This class contains a discriminated union of information about pointers in memory operands...
std::string & str()
Flushes the stream contents to the target string and returns the string's reference.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
SDValue LowerCallResult(SDValue Chain, SDValue InFlag, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl< ISD::InputArg > &Ins, const SDLoc &dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals, const SmallVectorImpl< SDValue > &OutVals, SDValue Callee) const
LowerCallResult - Lower the result values of an ISD::CALL into the appropriate copies out of appropri...
SDValue getPICJumpTableRelocBase(SDValue Table, SelectionDAG &DAG) const override
Returns relocation base for the given PIC jumptable.
This struct is a compact representation of a valid (non-zero power of two) alignment.
bool shouldReduceLoadWidth(SDNode *Load, ISD::LoadExtType ExtTy, EVT NewVT) const override
Return true if it is profitable to reduce a load to a smaller type.
SDValue getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT)
Return the expression required to zero extend the Op value assuming it was the smaller SrcTy value...
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands...
bool isUnindexed() const
Return true if this is NOT a pre/post inc/dec load/store.
SDValue getTargetBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, unsigned TargetFlags=0)
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
This callback is invoked for operations that are unsupported by the target, which are registered to u...
SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl< ISD::OutputArg > &Outs, const SmallVectorImpl< SDValue > &OutVals, const SDLoc &dl, SelectionDAG &DAG) const override
This hook must be implemented to lower outgoing return values, described by the Outs array...
The memory access writes data.
const APFloat & getValueAPF() const
virtual void LowerOperationWrapper(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const
This callback is invoked by the type legalizer to legalize nodes with an illegal operand type but leg...
SDValue getBitcast(EVT VT, SDValue V)
Return a bitcast using the SDLoc of the value operand, and casting to the provided type...
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
bool allowsMemoryAccessForAlignment(LLVMContext &Context, const DataLayout &DL, EVT VT, unsigned AddrSpace=0, unsigned Alignment=1, MachineMemOperand::Flags Flags=MachineMemOperand::MONone, bool *Fast=nullptr) const
This function returns true if the memory access is aligned or if the target allows this specific unal...
SDValue LowerStore(SDValue Op, SelectionDAG &DAG) const
TokenFactor - This node takes multiple tokens as input and produces a single token result...
const char * getTargetNodeName(unsigned Opcode) const override
This method returns the name of a target specific DAG node.
void dump() const
Dump this node, for debugging.
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
bool isHVXVectorType(MVT VecTy, bool IncludeBool=false) const
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace, unsigned Align, MachineMemOperand::Flags Flags, bool *Fast) const override
Determine if the target supports unaligned memory accesses.
SDValue getTargetConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offset=0, unsigned TargetFlags=0)
unsigned getNumOperands() const
CCState - This class holds information needed while lowering arguments and return values...
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned TargetFlags=0)
SDValue getMemBasePlusOffset(SDValue Base, int64_t Offset, const SDLoc &DL, const SDNodeFlags Flags=SDNodeFlags())
Returns sum of the base pointer and offset.
virtual bool shouldReduceLoadWidth(SDNode *Load, ISD::LoadExtType ExtTy, EVT NewVT) const
Return true if it is profitable to reduce a load to a smaller type.
static unsigned getIntrinsicID(const SDNode *N)
This is the shared class of boolean and integer constants.
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
Align max(MaybeAlign Lhs, Align Rhs)
SDValue LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG) const
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
SDValue LowerGLOBAL_OFFSET_TABLE(SDValue Op, SelectionDAG &DAG) const
This struct is a compact representation of a valid (power of two) or undefined (0) alignment...
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
SDValue getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either zero-extending or trunca...
SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
const DebugLoc & getDebugLoc() const
CCValAssign - Represent assignment of one arg/retval to a location.
SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl< ISD::InputArg > &Ins, const SDLoc &dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals) const override
This hook must be implemented to lower the incoming (formal) arguments, described by the Ins array...
SDValue getMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool AlwaysInline, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
constexpr size_t array_lengthof(T(&)[N])
Find the length of an array.
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
Promote Memory to Register
Byte Swap and Counting operators.
MO_PCREL - On a symbol operand, indicates a PC-relative relocation Used for computing a global addres...
bool hasBitTest(SDValue X, SDValue Y) const override
Return true if the target has a bit-test instruction: (X & (1 << Y)) ==/!= 0 This knowledge can be us...
ConstantInt * getInt32(uint32_t C)
Get a constant 32-bit value.
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool IsImmutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
SDValue LowerGLOBALADDRESS(SDValue Op, SelectionDAG &DAG) const
const Constant * getConstVal() const
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.
void setAdjustsStack(bool V)
unsigned getNumIncomingValues() const
Return the number of incoming edges.
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
const Function & getFunction() const
Return the LLVM function that this machine code represents.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
static mvt_range integer_valuetypes()
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
FunctionType * getFunctionType() const
Returns the FunctionType for me.
SDValue LowerINLINEASM(SDValue Op, SelectionDAG &DAG) const
const Module * getModule() const
Return the module owning the function this instruction belongs to or nullptr it the function does not...
void setIndexedLoadAction(unsigned IdxMode, MVT VT, LegalizeAction Action)
Indicate that the specified indexed load does or does not work with the specified type and indicate w...
EVT getMemoryVT() const
Return the type of the in-memory value.
Class for arbitrary precision integers.
unsigned getByValAlign() const
SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const
SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT, bool isTarget=false)
Create a ConstantFPSDNode wrapping a constant value.
amdgpu Simplify well known AMD library false FunctionCallee Callee
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
Select(COND, TRUEVAL, FALSEVAL).
ZERO_EXTEND - Used for integer types, zeroing the new bits.
ANY_EXTEND - Used for integer types. The high bits are undefined.
AtomicExpansionKind shouldExpandAtomicLoadInIR(LoadInst *LI) const override
Returns how the given (atomic) load should be expanded by the IR-level AtomicExpand pass...
SDValue GetDynamicTLSAddr(SelectionDAG &DAG, SDValue Chain, GlobalAddressSDNode *GA, SDValue InFlag, EVT PtrVT, unsigned ReturnReg, unsigned char OperandFlags) const
SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG) const
SDValue expandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG) const
Expands an unaligned store to 2 half-size stores for integer values, and possibly more for vectors...
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
static cl::opt< int > MaxStoresPerMemsetCL("max-store-memset", cl::Hidden, cl::ZeroOrMore, cl::init(8), cl::desc("Max #stores to inline memset"))
Flags
Flags values. These may be or'd together.
SDValue LowerINSERT_SUBVECTOR(SDValue Op, SelectionDAG &DAG) const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
The memory access reads data.
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
BR_JT - Jumptable branch.
VACOPY - VACOPY has 5 operands: an input chain, a destination pointer, a source pointer, a SRCVALUE for the destination, and a SRCVALUE for the source.
TypeSize getStoreSizeInBits() const
Return the number of bits overwritten by a store of the specified value type.
SmallVector< SDValue, 32 > OutVals
static cl::opt< bool > EnableHexSDNodeSched("enable-hexagon-sdnode-sched", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Enable Hexagon SDNode scheduling"))
bool CheckReturn(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
CheckReturn - Analyze the return values of a function, returning true if the return can be performed ...
unsigned getVectorLength() const
Bitwise operators - logical and, logical or, logical xor.
MO_GOT - Indicates a GOT-relative relocation.
SDValue LowerREADCYCLECOUNTER(SDValue Op, SelectionDAG &DAG) const
unsigned getTypeAlignment(MVT Ty) const
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT)
SDValue LowerUAddSubO(SDValue Op, SelectionDAG &DAG) const
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
static IntegerType * getInt32Ty(LLVMContext &C)
unsigned getLocMemOffset() const
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
LLVM_NODISCARD bool empty() const
int getVarArgsFrameIndex()
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
PointerUnion< const Value *, const PseudoSourceValue * > ptrVal
SDValue LowerUnalignedLoad(SDValue Op, SelectionDAG &DAG) const
BasicBlock * getIncomingBlock(unsigned i) const
Return incoming basic block number i.
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation.
const Function * getParent() const
Return the enclosing method, or null if none.
SDValue LowerBITCAST(SDValue Op, SelectionDAG &DAG) const
void AnalyzeReturn(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeReturn - Analyze the returned values of a return, incorporating info about the result values i...
const TargetSubtargetInfo & getSubtarget() const
static cl::opt< int > MaxStoresPerMemcpyOptSizeCL("max-store-memcpy-Os", cl::Hidden, cl::ZeroOrMore, cl::init(4), cl::desc("Max #stores to inline memcpy"))
unsigned getRARegister() const
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
unsigned MaxStoresPerMemmoveOptSize
Likewise for functions with the OptSize attribute.
bool isZero() const
This is just a convenience method to make client code smaller for a common code.
Value * emitLoadLinked(IRBuilder<> &Builder, Value *Addr, AtomicOrdering Ord) const override
Perform a load-linked operation on Addr, returning a "Value *" with the corresponding pointee type...
unsigned MaxStoresPerMemcpyOptSize
Likewise for functions with the OptSize attribute.
void setStackPointerRegisterToSaveRestore(unsigned R)
If set to a physical register, this specifies the register that llvm.savestack/llvm.restorestack should save and restore.
void setLibcallName(RTLIB::Libcall Call, const char *Name)
Rename the default libcall routine name for the specified libcall.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
CallInst * CreateCall(FunctionType *FTy, Value *Callee, ArrayRef< Value *> Args=None, const Twine &Name="", MDNode *FPMathTag=nullptr)
unsigned getOpcode() const
FSINCOS - Compute both fsin and fcos as a single operation.
SDValue getValue(unsigned R) const
unsigned MaxStoresPerMemcpy
Specify maximum number of store instructions per memcpy call.
bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override
Return true if folding a constant offset with the given GlobalAddress is legal.
TypeSize getTypeAllocSizeInBits(Type *Ty) const
Returns the offset in bits between successive objects of the specified type, including alignment padd...
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
SDValue LowerLoad(SDValue Op, SelectionDAG &DAG) const
Register getRegisterByName(const char *RegName, LLT VT, const MachineFunction &MF) const override
Return the register ID of the name passed in.
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
OUTCHAIN = EH_RETURN(INCHAIN, OFFSET, HANDLER) - This node represents 'eh_return' gcc dwarf builtin...
const GlobalObject * getBaseObject() const
SDValue getGLOBAL_OFFSET_TABLE(EVT VT)
Return a GLOBAL_OFFSET_TABLE node. This does not have a useful SDLoc.
CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of vector type with the same length ...
MachineConstantPoolValue * getMachineCPVal() const
SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
void dumpr() const
Dump (recursively) this node and its use-def subgraph.
LegalizeTypeAction
This enum indicates whether a types are legal for a target, and if not, what action should be used to...
#define Hexagon_PointerSize
void setReturnAddressIsTaken(bool s)
INLINEASM_BR - Terminator version of inline asm. Used by asm-goto.
static cl::opt< int > MaxStoresPerMemcpyCL("max-store-memcpy", cl::Hidden, cl::ZeroOrMore, cl::init(6), cl::desc("Max #stores to inline memcpy"))
A raw_ostream that writes to an std::string.
void setSchedulingPreference(Sched::Preference Pref)
Specify the target scheduling preference.
SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
FMA - Perform a * b + c with no intermediate rounding step.
SDValue getLogicalNOT(const SDLoc &DL, SDValue Val, EVT VT)
Create a logical NOT operation as (XOR Val, BooleanOne).
SDValue getRegister(unsigned Reg, EVT VT)
Fast - This calling convention attempts to make calls as fast as possible (e.g.
SDValue getAnyExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either any-extending or truncat...
unsigned getOpcode() const
Return the opcode for this Instruction or ConstantExpr.
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.
PREFETCH - This corresponds to a prefetch intrinsic.
SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG) const
void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
Replace any uses of From with To, leaving uses of other values produced by From.getNode() alone...
Primary interface to the complete machine description for the target machine.
static mvt_range fixedlen_vector_valuetypes()
ConstantInt * getInt8(uint8_t C)
Get a constant 8-bit value.
static MachinePointerInfo getStack(MachineFunction &MF, int64_t Offset, uint8_t ID=0)
Stack pointer relative access.
StringRef - Represent a constant reference to a string, i.e.
SDValue LowerCall(TargetLowering::CallLoweringInfo &CLI, SmallVectorImpl< SDValue > &InVals) const override
LowerCall - Functions arguments are copied from virtual regs to (physical regs)/(stack frame)...
SetCC operator - This evaluates to a true value iff the condition is true.
APInt bitcastToAPInt() const
unsigned MaxStoresPerMemset
Specify maximum number of store instructions per memset call.
unsigned MaxStoresPerMemsetOptSize
Likewise for functions with the OptSize attribute.
bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF, bool isVarArg, const SmallVectorImpl< ISD::OutputArg > &Outs, LLVMContext &Context) const override
This hook should be implemented to check whether the return values described by the Outs array can fi...
unsigned getNumOperands() const
const SDValue & getOperand(unsigned i) const
uint64_t getZExtValue() const
TRUNCATE - Completely drop the high bits.
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
bool IsEligibleForTailCallOptimization(SDValue Callee, CallingConv::ID CalleeCC, bool isVarArg, bool isCalleeStructRet, bool isCallerStructRet, const SmallVectorImpl< ISD::OutputArg > &Outs, const SmallVectorImpl< SDValue > &OutVals, const SmallVectorImpl< ISD::InputArg > &Ins, SelectionDAG &DAG) const
IsEligibleForTailCallOptimization - Check whether the call is eligible for tail call optimization...
static cl::opt< int > MaxStoresPerMemmoveCL("max-store-memmove", cl::Hidden, cl::ZeroOrMore, cl::init(6), cl::desc("Max #stores to inline memmove"))
static cl::opt< int > MaxStoresPerMemsetOptSizeCL("max-store-memset-Os", cl::Hidden, cl::ZeroOrMore, cl::init(4), cl::desc("Max #stores to inline memset"))
unsigned AllocateReg(unsigned Reg)
AllocateReg - Attempt to allocate one register.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
Perform various unary floating-point operations inspired by libm.
static cl::opt< bool > EnableFastMath("ffast-math", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Enable Fast Math processing"))
Function Alias Analysis false
static Constant * convert_i1_to_i8(const Constant *ConstVal)
SDValue LowerROTL(SDValue Op, SelectionDAG &DAG) const
LLVMContext * getContext() const
SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a scalar value into element 0 of the...
static Constant * get(ArrayRef< Constant *> V)
SDValue LowerPREFETCH(SDValue Op, SelectionDAG &DAG) const
Carry-using nodes for multiple precision addition and subtraction.
Wrapper class representing virtual and physical registers.
const BasicBlock * getParent() const
HexagonTargetLowering(const TargetMachine &TM, const HexagonSubtarget &ST)
void setIndexedStoreAction(unsigned IdxMode, MVT VT, LegalizeAction Action)
Indicate that the specified indexed store does or does not work with the specified type and indicate ...
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
This class is used to represent ISD::LOAD nodes.
DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned to a specified boundary...