22 #ifndef LLVM_CODEGEN_TARGETLOWERING_H 23 #define LLVM_CODEGEN_TARGETLOWERING_H 70 class BranchProbability;
75 class FunctionLoweringInfo;
80 class LegacyDivergenceAnalysis;
82 class MachineBasicBlock;
83 class MachineFunction;
85 class MachineJumpTableInfo;
87 class MachineRegisterInfo;
91 class TargetRegisterClass;
92 class TargetLibraryInfo;
93 class TargetRegisterInfo;
145 ZeroOrNegativeOneBooleanContent
202 void setAttributes(
const CallBase *Call,
unsigned ArgIdx);
205 return setAttributes(cast<CallBase>(CS->
getInstruction()), ArgIdx);
215 case UndefinedBooleanContent:
218 case ZeroOrOneBooleanContent:
221 case ZeroOrNegativeOneBooleanContent:
235 return IsStrictFPEnabled;
270 return getPointerTy(DL);
278 bool LegalTypes =
true)
const;
284 return getPointerTy(DL);
301 return HasMultipleConditionRegisters;
312 return TypeScalarizeVector;
315 return TypeWidenVector;
317 return TypePromoteInteger;
331 unsigned DefinedValues)
const {
332 return DefinedValues < 3;
389 return BypassSlowDivWidths;
399 return PredictableSelectIsExpensive;
424 if (getOperationAction(
ISD::LOAD, LoadMVT) == Promote &&
439 return isLoadBitCastBeneficial(StoreVT, BitcastVT, DAG, MMO);
447 unsigned AddrSpace)
const {
551 return hasAndNotCompare(X);
587 unsigned KeptBits)
const {
601 unsigned OldShiftOpcode,
unsigned NewShiftOpcode,
603 if (hasBitTest(X, Y)) {
643 unsigned &Cost)
const {
685 return BooleanVectorContents;
686 return isFloat ? BooleanFloatContents : BooleanContents;
695 return SchedPreferenceInfo;
710 assert(RC &&
"This value type is not natively supported!");
718 const Value *)
const {
737 return RepRegClassCostForVT[VT.
SimpleTy];
768 return ValueTypeActions[VT.
SimpleTy];
772 ValueTypeActions[VT.
SimpleTy] = Action;
777 return ValueTypeActions;
785 return getTypeConversion(Context, VT).first;
788 return ValueTypeActions.getTypeAction(VT);
798 return getTypeConversion(Context, VT).second;
808 switch (getTypeAction(Context, VT)) {
811 case TypeExpandInteger:
812 VT = getTypeToTransformTo(Context, VT);
830 unsigned &NumIntermediates,
831 MVT &RegisterVT)
const;
838 unsigned &NumIntermediates,
MVT &RegisterVT)
const {
839 return getVectorTypeBreakdown(Context, VT, IntermediateVT, NumIntermediates,
873 bool ForCodeSize =
false)
const {
889 virtual bool canOpTrap(
unsigned Op,
EVT VT)
const;
914 unsigned Scale)
const {
923 unsigned Scale)
const {
924 auto Action = getOperationAction(Op, VT);
940 Supported = isSupportedFixedPointOperation(Op, VT, Scale);
944 return Supported ? Action : Expand;
953 #define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \ 954 case ISD::STRICT_##DAGN: EqOpc = ISD::DAGN; break; 955 #define CMP_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \ 956 case ISD::STRICT_##DAGN: EqOpc = ISD::SETCC; break; 957 #include "llvm/IR/ConstrainedOps.def" 960 return getOperationAction(EqOpc, VT);
967 return (VT ==
MVT::Other || isTypeLegal(VT)) &&
968 (getOperationAction(Op, VT) ==
Legal ||
969 getOperationAction(Op, VT) == Custom);
976 return (VT ==
MVT::Other || isTypeLegal(VT)) &&
977 (getOperationAction(Op, VT) ==
Legal ||
978 getOperationAction(Op, VT) == Promote);
985 return (VT ==
MVT::Other || isTypeLegal(VT)) &&
986 (getOperationAction(Op, VT) ==
Legal ||
987 getOperationAction(Op, VT) == Custom ||
988 getOperationAction(Op, VT) == Promote);
994 return getOperationAction(Op, VT) == Custom;
1011 uint64_t Range = (High - Low).getLimitedValue(
UINT64_MAX - 1) + 1;
1017 virtual bool isSuitableForJumpTable(
const SwitchInst *
SI, uint64_t NumCases,
1036 if (!rangeFitsInWord(Low, High, DL))
1044 return (NumDests == 1 && NumCmps >= 3) || (NumDests == 2 && NumCmps >= 5) ||
1045 (NumDests == 3 && NumCmps >= 6);
1052 return (!isTypeLegal(VT) || getOperationAction(Op, VT) == Expand);
1057 return (VT ==
MVT::Other || isTypeLegal(VT)) &&
1058 getOperationAction(Op, VT) ==
Legal;
1072 return (
LegalizeAction)((LoadExtActions[ValI][MemI] >> Shift) & 0xf);
1077 return getLoadExtAction(ExtType, ValVT, MemVT) ==
Legal;
1083 return getLoadExtAction(ExtType, ValVT, MemVT) ==
Legal ||
1084 getLoadExtAction(ExtType, ValVT, MemVT) == Custom;
1095 "Table isn't big enough!");
1096 return TruncStoreActions[ValI][MemI];
1102 return isTypeLegal(ValVT) && getTruncStoreAction(ValVT, MemVT) ==
Legal;
1108 return isTypeLegal(ValVT) &&
1109 (getTruncStoreAction(ValVT, MemVT) ==
Legal ||
1110 getTruncStoreAction(ValVT, MemVT) == Custom);
1117 return getIndexedModeAction(IdxMode, VT, IMAB_Load);
1124 getIndexedLoadAction(IdxMode, VT.
getSimpleVT()) == Custom);
1131 return getIndexedModeAction(IdxMode, VT, IMAB_Store);
1138 getIndexedStoreAction(IdxMode, VT.
getSimpleVT()) == Custom);
1145 return getIndexedModeAction(IdxMode, VT, IMAB_MaskedLoad);
1152 getIndexedMaskedLoadAction(IdxMode, VT.
getSimpleVT()) == Custom);
1159 return getIndexedModeAction(IdxMode, VT, IMAB_MaskedStore);
1166 getIndexedMaskedStoreAction(IdxMode, VT.
getSimpleVT()) == Custom);
1176 "Table isn't big enough!");
1181 assert(Action != Promote &&
"Can't promote condition code!");
1187 return getCondCodeAction(CC, VT) ==
Legal;
1193 return getCondCodeAction(CC, VT) ==
Legal ||
1194 getCondCodeAction(CC, VT) == Custom;
1200 assert(getOperationAction(Op, VT) == Promote &&
1201 "This operation isn't promoted!");
1204 std::map<std::pair<unsigned, MVT::SimpleValueType>,
1206 PromoteToType.find(std::make_pair(Op, VT.
SimpleTy));
1207 if (PTTI != PromoteToType.end())
return PTTI->second;
1210 "Cannot autopromote this type, add it with AddPromotedToType.");
1216 "Didn't find type to promote to!");
1217 }
while (!isTypeLegal(NVT) ||
1218 getOperationAction(Op, NVT) == Promote);
1227 bool AllowUnknown =
false)
const {
1229 if (
auto *PTy = dyn_cast<PointerType>(Ty))
1230 return getPointerTy(DL, PTy->getAddressSpace());
1232 if (
auto *VTy = dyn_cast<VectorType>(Ty)) {
1233 Type *EltTy = VTy->getElementType();
1235 if (
auto *PTy = dyn_cast<PointerType>(EltTy)) {
1236 EVT PointerTy(getPointerTy(DL, PTy->getAddressSpace()));
1240 VTy->getElementCount());
1247 bool AllowUnknown =
false)
const {
1250 return getPointerMemTy(DL, PTy->getAddressSpace());
1251 else if (
VectorType *VTy = dyn_cast<VectorType>(Ty)) {
1252 Type *Elm = VTy->getElementType();
1253 if (
PointerType *PT = dyn_cast<PointerType>(Elm)) {
1254 EVT PointerTy(getPointerMemTy(DL, PT->getAddressSpace()));
1258 VTy->getElementCount());
1261 return getValueType(DL, Ty, AllowUnknown);
1267 bool AllowUnknown =
false)
const {
1268 return getValueType(DL, Ty, AllowUnknown).getSimpleVT();
1274 virtual unsigned getByValTypeAlignment(
Type *Ty,
const DataLayout &DL)
const;
1279 return RegisterTypeForVT[VT.
SimpleTy];
1292 unsigned NumIntermediates;
1293 (void)getVectorTypeBreakdown(Context, VT, VT1,
1294 NumIntermediates, RegisterVT);
1298 return getRegisterType(Context, getTypeToTransformTo(Context, VT));
1320 unsigned NumIntermediates;
1321 return getVectorTypeBreakdown(Context, VT, VT1, NumIntermediates, VT2);
1325 unsigned RegWidth = getRegisterType(Context, VT).getSizeInBits();
1326 return (BitWidth + RegWidth - 1) / RegWidth;
1336 return getRegisterType(Context, VT);
1345 return getNumRegisters(Context, VT);
1383 return TargetDAGCombineArray[NT >> 3] & (1 << (NT&7));
1387 return GatherAllAliasesMaxDepth;
1392 return getPointerTy(DL).getSizeInBits();
1402 return OptSize ? MaxStoresPerMemsetOptSize : MaxStoresPerMemset;
1412 return OptSize ? MaxStoresPerMemcpyOptSize : MaxStoresPerMemcpy;
1421 return MaxGluedStoresPerMemcpy;
1441 return OptSize ? MaxStoresPerMemmoveOptSize : MaxStoresPerMemmove;
1454 EVT,
unsigned AddrSpace = 0,
unsigned Align = 1,
1456 bool * =
nullptr)
const {
1462 LLT,
unsigned AddrSpace = 0,
unsigned Align = 1,
1464 bool * =
nullptr)
const {
1472 bool allowsMemoryAccessForAlignment(
1474 unsigned AddrSpace = 0,
unsigned Alignment = 1,
1476 bool *
Fast =
nullptr)
const;
1482 bool allowsMemoryAccessForAlignment(
LLVMContext &Context,
1485 bool *
Fast =
nullptr)
const;
1493 unsigned AddrSpace = 0,
unsigned Alignment = 1,
1495 bool *
Fast =
nullptr)
const;
1503 bool *
Fast =
nullptr)
const;
1544 virtual unsigned getMinimumJumpTableEntries()
const;
1547 unsigned getMinimumJumpTableDensity(
bool OptForSize)
const;
1551 unsigned getMaximumJumpTableSize()
const;
1560 return StackPointerRegisterToSaveRestore;
1585 return MinStackArgumentAlignment;
1596 return PrefLoopAlignment;
1613 virtual void insertSSPDeclarations(
Module &M)
const;
1618 virtual Value *getSDagStackGuard(
const Module &M)
const;
1655 return isNoopAddrSpaceCast(SrcAS, DestAS);
1663 unsigned & )
const {
1672 int InstructionOpcodeToISD(
unsigned Opcode)
const;
1675 std::pair<int, MVT> getTypeLegalizationCost(
const DataLayout &DL,
1689 return MaxAtomicSizeInBitsSupported;
1735 llvm_unreachable(
"Masked atomicrmw expansion unimplemented on this target");
1875 if (hasMultipleConditionRegisters())
1880 return Action != TypeExpandInteger && Action != TypeExpandFloat &&
1881 Action != TypeSplitVector;
1909 bool IsSigned)
const {
1921 BooleanContents = Ty;
1922 BooleanFloatContents = Ty;
1928 BooleanContents = IntTy;
1929 BooleanFloatContents = FloatTy;
1935 BooleanVectorContents = Ty;
1940 SchedPreferenceInfo = Pref;
1944 void setMinimumJumpTableEntries(
unsigned Val);
1948 void setMaximumJumpTableSize(
unsigned);
1953 StackPointerRegisterToSaveRestore = R;
1962 HasMultipleConditionRegisters = hasManyRegs;
1970 HasExtractBitsInsn = hasExtractInsn;
1976 void setJumpIsExpensive(
bool isExpensive =
true);
1980 BypassSlowDivWidths[SlowBitWidth] = FastBitWidth;
1993 virtual std::pair<const TargetRegisterClass *, uint8_t>
2014 MemVT.
isValid() &&
"Table isn't big enough!");
2015 assert((
unsigned)Action < 0x10 &&
"too many bits for bitfield array");
2035 setIndexedModeAction(IdxMode, VT, IMAB_Load, Action);
2044 setIndexedModeAction(IdxMode, VT, IMAB_Store, Action);
2054 setIndexedModeAction(IdxMode, VT, IMAB_MaskedLoad, Action);
2064 setIndexedModeAction(IdxMode, VT, IMAB_MaskedStore, Action);
2072 "Table isn't big enough!");
2073 assert((
unsigned)Action < 0x10 &&
"too many bits for bitfield array");
2093 setOperationAction(Opc, OrigVT, Promote);
2094 AddPromotedToType(Opc, OrigVT, DestVT);
2102 TargetDAGCombineArray[NT >> 3] |= 1 << (NT&7);
2107 MinFunctionAlignment = Alignment;
2113 PrefFunctionAlignment = Alignment;
2123 MinStackArgumentAlignment = Alignment;
2131 MaxAtomicSizeInBitsSupported = SizeInBits;
2136 MinCmpXchgSizeInBits = SizeInBits;
2141 SupportsUnalignedAtomics = UnalignedSupported;
2169 int64_t BaseOffs = 0;
2170 bool HasBaseReg =
false;
2186 Type *Ty,
unsigned AddrSpace,
2197 Type *Ty,
unsigned AS = 0)
const {
2199 if (isLegalAddressingMode(DL, AM, Ty, AS))
2266 default:
return false;
2273 if (isCommutativeBinOp(Opcode))
2328 case Instruction::FPExt:
2333 case Instruction::ZExt:
2337 case Instruction::SExt:
2342 return isExtFreeImpl(I);
2354 EVT LoadVT = getValueType(DL, Load->
getType());
2358 if (!Load->
hasOneUse() && (isTypeLegal(LoadVT) || !isTypeLegal(VT)) &&
2364 if (isa<ZExtInst>(Ext))
2367 assert(isa<SExtInst>(Ext) &&
"Unexpected ext type!");
2371 return isLoadExtLegal(LType, VT, LoadVT);
2430 unsigned & )
const {
2451 unsigned Factor)
const {
2462 unsigned Factor)
const {
2478 "invalid fpext types");
2486 EVT DestVT,
EVT SrcVT)
const {
2488 "invalid fpext types");
2489 return isFPExtFree(DestVT, SrcVT);
2558 unsigned Index)
const {
2590 return VT.
isSimple() || !isOperationExpand(Opcode, VT);
2627 CmpLibcallCCs[Call] = CC;
2633 return CmpLibcallCCs[Call];
2638 LibcallCallingConvs[Call] = CC;
2643 return LibcallCallingConvs[Call];
2660 bool HasMultipleConditionRegisters;
2666 bool HasExtractBitsInsn;
2677 bool JumpIsExpensive;
2696 Align MinStackArgumentAlignment;
2700 Align MinFunctionAlignment;
2704 Align PrefFunctionAlignment;
2707 Align PrefLoopAlignment;
2711 unsigned MaxAtomicSizeInBitsSupported;
2715 unsigned MinCmpXchgSizeInBits;
2718 bool SupportsUnalignedAtomics;
2722 unsigned StackPointerRegisterToSaveRestore;
2814 void InitLibcalls(
const Triple &
TT);
2818 enum IndexedModeActionsBits {
2821 IMAB_MaskedStore = 8,
2822 IMAB_MaskedLoad = 12
2825 void setIndexedModeAction(
unsigned IdxMode,
MVT VT,
unsigned Shift,
2828 (
unsigned)Action < 0xf &&
"Table isn't big enough!");
2830 IndexedModeActions[Ty][IdxMode] &= ~(0xf << Shift);
2831 IndexedModeActions[Ty][IdxMode] |= ((
uint16_t)Action) << Shift;
2835 unsigned Shift)
const {
2837 "Table isn't big enough!");
2839 return (
LegalizeAction)((IndexedModeActions[Ty][IdxMode] >> Shift) & 0xf);
2887 unsigned MaxGluedStoresPerMemcpy = 0;
2963 bool isPositionIndependent()
const;
3006 virtual unsigned getJumpTableEncoding()
const;
3041 bool IsSignaling =
false)
const;
3055 const uint32_t *CallerPreservedMask,
3075 DAG(InDAG), LegalTys(LT), LegalOps(LO) {}
3091 bool findOptimalMemOpLowering(std::vector<EVT> &MemOps,
3092 unsigned Limit, uint64_t
Size,
3093 unsigned DstAlign,
unsigned SrcAlign,
3098 unsigned DstAS,
unsigned SrcAS,
3119 bool ShrinkDemandedOp(
SDValue Op,
unsigned BitWidth,
const APInt &Demanded,
3138 bool AssumeSingleUse =
false)
const;
3142 bool SimplifyDemandedBits(
SDValue Op,
const APInt &DemandedBits,
3145 bool AssumeSingleUse =
false)
const;
3149 bool SimplifyDemandedBits(
SDValue Op,
const APInt &DemandedMask,
3156 const APInt &DemandedElts,
3158 unsigned Depth)
const;
3174 bool SimplifyDemandedVectorElts(
SDValue Op,
const APInt &DemandedEltMask,
3177 bool AssumeSingleUse =
false)
const;
3181 bool SimplifyDemandedVectorElts(
SDValue Op,
const APInt &DemandedElts,
3189 virtual void computeKnownBitsForTargetNode(
const SDValue Op,
3191 const APInt &DemandedElts,
3193 unsigned Depth = 0)
const;
3200 const APInt &DemandedElts,
3202 unsigned Depth = 0)
const;
3207 virtual void computeKnownBitsForFrameIndex(
const SDValue FIOp,
3209 const APInt &DemandedElts,
3211 unsigned Depth = 0)
const;
3217 virtual unsigned ComputeNumSignBitsForTargetNode(
SDValue Op,
3218 const APInt &DemandedElts,
3220 unsigned Depth = 0)
const;
3227 virtual bool SimplifyDemandedVectorEltsForTargetNode(
3236 virtual bool SimplifyDemandedBitsForTargetNode(
SDValue Op,
3237 const APInt &DemandedBits,
3238 const APInt &DemandedElts,
3241 unsigned Depth = 0)
const;
3246 virtual SDValue SimplifyMultipleUseDemandedBitsForTargetNode(
3265 virtual bool isKnownNeverNaNForTargetNode(
SDValue Op,
3268 unsigned Depth = 0)
const;
3278 : DC(dc), Level(level), CalledByLegalizer(cl), DAG(dag) {}
3286 void AddToWorklist(
SDNode *
N);
3291 bool recursivelyDeleteUnusedNodes(
SDNode *N);
3298 bool isConstTrueVal(
const SDNode *
N)
const;
3302 bool isConstFalseVal(
const SDNode *N)
const;
3311 const SDLoc &dl)
const;
3369 return isTypeLegal(VT);
3420 bool LegalOperations,
bool ForCodeSize,
3421 unsigned Depth = 0)
const;
3425 bool LegalOperations,
bool ForCodeSize,
3426 unsigned Depth = 0)
const;
3462 bool IsTailCall =
false;
3465 bool IsPostTypeLegalization =
false;
3481 DoesNotReturn(
false), IsReturnValueUsed(
true), IsConvergent(
false),
3482 IsPatchPoint(
false), DAG(DAG) {}
3500 NumFixedArgs = ArgsList.size();
3501 Args = std::move(ArgsList);
3513 NumFixedArgs = ArgsList.size();
3514 Args = std::move(ArgsList);
3537 Args = std::move(ArgsList);
3550 DoesNotReturn =
Value;
3565 IsReturnValueUsed = !
Value;
3570 IsConvergent =
Value;
3585 IsPatchPoint =
Value;
3590 IsPostTypeLegalization =
Value;
3613 IsPostTypeLegalization(
false), IsSoften(
false) {}
3621 DoesNotReturn =
Value;
3626 IsReturnValueUsed = !
Value;
3631 IsPostTypeLegalization =
Value;
3636 bool Value =
true) {
3637 OpsVTBeforeSoften = OpsVT;
3638 RetVTBeforeSoften = RetVT;
3707 return "__clear_cache";
3727 return VT.
bitsLT(MinVT) ? MinVT : VT;
3735 bool isVarArg)
const {
3805 virtual void LowerOperationWrapper(
SDNode *N,
3832 virtual const char *getTargetNodeName(
unsigned Opcode)
const;
3841 bool verifyReturnAddressArgumentIsConstant(
SDValue Op,
3874 CW_SpecificReg = CW_Okay,
3875 CW_Register = CW_Good,
3876 CW_Memory = CW_Better,
3877 CW_Constant = CW_Best,
3878 CW_Default = CW_Okay
3906 bool isMatchingInputConstraint()
const;
3910 unsigned getMatchedOperand()
const;
3953 virtual std::pair<unsigned, const TargetRegisterClass *>
3958 if (ConstraintCode ==
"m")
3966 virtual const char *LowerXConstraint(
EVT ConstraintVT)
const;
3970 virtual void LowerAsmOperandForConstraint(
SDValue Op, std::string &Constraint,
3971 std::vector<SDValue> &Ops,
4023 int Enabled,
int &RefinementSteps,
4024 bool &UseOneConstNR,
bool Reciprocal)
const {
4039 int Enabled,
int &RefinementSteps)
const {
4146 std::pair<SDValue, SDValue> scalarizeVectorLoad(
LoadSDNode *LD,
4156 std::pair<SDValue, SDValue> expandUnalignedLoad(
LoadSDNode *LD,
4172 bool IsCompressedMemory)
const;
4193 SDValue expandFixedPointDiv(
unsigned Opcode,
const SDLoc &dl,
4235 virtual void AdjustInstrPostInstrSelection(
MachineInstr &MI,
4245 const SDLoc &DL)
const {
4275 const SDLoc &DL)
const;
4278 SDValue optimizeSetCCByHoistingAndByConstFromLogicalShift(
4288 const SDLoc &DL)
const;
4296 const SDLoc &DL)
const;
4308 #endif // LLVM_CODEGEN_TARGETLOWERING_H virtual AtomicExpansionKind shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *AI) const
Returns how the given atomic cmpxchg should be expanded by the IR-level AtomicExpand pass...
LegalizeAction getLoadExtAction(unsigned ExtType, EVT ValVT, EVT MemVT) const
Return how this load with extension should be treated: either it is legal, needs to be promoted to a ...
virtual bool isJumpTableRelative() const
static MVT getIntegerVT(unsigned BitWidth)
BUILTIN_OP_END - This must be the last enum value in this list.
A parsed version of the target data layout string in and methods for querying it. ...
const_iterator end(StringRef path)
Get end iterator over path.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
virtual MVT getVectorIdxTy(const DataLayout &DL) const
Returns the type to be used for the index operand of: ISD::INSERT_VECTOR_ELT, ISD::EXTRACT_VECTOR_ELT...
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.
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...
virtual bool canMergeStoresTo(unsigned AS, EVT MemVT, const SelectionDAG &DAG) const
Returns if it's reasonable to merge stores to MemVT size.
unsigned getIndexSizeInBits(unsigned AS) const
Size in bits of index used for address calculation in getelementptr.
CombineLevel getDAGCombineLevel()
MakeLibCallOptions & setTypeListBeforeSoften(ArrayRef< EVT > OpsVT, EVT RetVT, bool Value=true)
unsigned MaxLoadsPerMemcmpOptSize
Likewise for functions with the OptSize attribute.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
virtual bool shouldInsertFencesForAtomic(const Instruction *I) const
Whether AtomicExpandPass should automatically insert fences and reduce ordering for this atomic...
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
Atomic ordering constants.
NodeTy * getNextNode()
Get the next node, or nullptr for the list tail.
virtual SDValue expandIndirectJTBranch(const SDLoc &dl, SDValue Value, SDValue Addr, SelectionDAG &DAG) const
Expands target specific indirect branch for the case of JumpTable expanasion.
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.
bool isOperationCustom(unsigned Op, EVT VT) const
Return true if the operation uses custom lowering, regardless of whether the type is legal or not...
bool isAtomic() const
Return true if this instruction has an AtomicOrdering of unordered or higher.
FMINIMUM/FMAXIMUM - NaN-propagating minimum/maximum that also treat -0.0 as less than 0...
A Module instance is used to store all the information related to an LLVM module. ...
virtual const TargetRegisterClass * getRepRegClassFor(MVT VT) const
Return the 'representative' register class for the specified value type.
virtual bool isMaskAndCmp0FoldingBeneficial(const Instruction &AndI) const
Return if the target supports combining a chain like:
This structure is used to pass arguments to makeLibCall function.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
An instruction that atomically checks whether a specified value is in a memory location, and, if it is, stores a new value there.
Same as the corresponding unsaturated fixed point instructions, but the result is clamped between the...
virtual bool shouldExtendTypeInLibCall(EVT Type) const
Returns true if arguments should be extended in lib calls.
CallLoweringInfo & setIsPostTypeLegalization(bool Value=true)
Sched::Preference getSchedulingPreference() const
Return target scheduling preference.
MakeLibCallOptions & setIsPostTypeLegalization(bool Value=true)
Carry-setting nodes for multiple precision addition and subtraction.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
virtual unsigned getVectorTypeBreakdownForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT, EVT &IntermediateVT, unsigned &NumIntermediates, MVT &RegisterVT) const
Certain targets such as MIPS require that some types such as vectors are always broken down into scal...
bool isPow2VectorType() const
Returns true if the given vector is a power of 2.
Analysis providing profile information.
virtual bool enableAggressiveFMAFusion(EVT VT) const
Return true if target always beneficiates from combining into FMA for a given value type...
virtual bool getPreIndexedAddressParts(SDNode *, SDValue &, SDValue &, ISD::MemIndexedMode &, SelectionDAG &) const
Returns true by value, base pointer and offset pointer and addressing mode by reference if the node's...
virtual SDValue getSqrtEstimate(SDValue Operand, SelectionDAG &DAG, int Enabled, int &RefinementSteps, bool &UseOneConstNR, bool Reciprocal) const
Hooks for building estimates in place of slower divisions and square roots.
This class represents a function call, abstracting a target machine's calling convention.
virtual bool isFNegFree(EVT VT) const
Return true if an fneg operation is free to the point where it is never worthwhile to replace it with...
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
virtual unsigned combineRepeatedFPDivisors() const
Indicate whether this target prefers to combine FDIVs with the same divisor.
Libcall
RTLIB::Libcall enum - This enum defines all of the runtime library calls the backend can emit...
virtual bool isExtractVecEltCheap(EVT VT, unsigned Index) const
Return true if extraction of a scalar element from the given vector type at the given index is cheap...
RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
static ISD::NodeType getExtendForContent(BooleanContent Content)
unsigned getVectorNumElements() const
virtual bool isSelectSupported(SelectSupportKind) const
Function Alias Analysis Results
bool isSuitableForBitTests(unsigned NumDests, unsigned NumCmps, const APInt &Low, const APInt &High, const DataLayout &DL) const
Return true if lowering to a bit test is suitable for a set of case clusters which contains NumDests ...
bool LegalOperations() const
This instruction constructs a fixed permutation of two input vectors.
virtual bool isCommutativeBinOp(unsigned Opcode) const
Returns true if the opcode is a commutative binary operation.
virtual void markLibCallAttributes(MachineFunction *MF, unsigned CC, ArgListTy &Args) const
bool hasRetAttr(Attribute::AttrKind Kind) const
Return true if this return value has the given attribute.
unsigned getMaxStoresPerMemset(bool OptSize) const
Get maximum # of store operations permitted for llvm.memset.
virtual void HandleByVal(CCState *, unsigned &, unsigned) const
Target-specific cleanup for formal ByVal parameters.
CallLoweringInfo & setNoReturn(bool Value=true)
virtual bool isSafeMemOpType(MVT) const
Returns true if it's safe to use load / store of the specified type to expand memcpy / memset inline...
bool isStrictFPEnabled() const
Return true if the target support strict float operation.
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...
C - The default llvm calling convention, compatible with C.
unsigned getPointerSizeInBits(unsigned AS=0) const
Layout pointer size, in bits FIXME: The defaults need to be removed once all of the backends/clients ...
LegalizeAction getIndexedStoreAction(unsigned IdxMode, MVT VT) const
Return how the indexed store should be treated: either it is legal, needs to be promoted to a larger ...
bool isTruncStoreLegal(EVT ValVT, EVT MemVT) const
Return true if the specified store with truncation is legal on this target.
unsigned const TargetRegisterInfo * TRI
bool isInteger() const
Return true if this is an integer or a vector integer type.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
virtual bool lowerAtomicLoadAsLoadSDNode(const LoadInst &LI) const
Should SelectionDAG lower an atomic load of the given kind as a normal LoadSDNode (as opposed to an A...
CallLoweringInfo & setDebugLoc(const SDLoc &dl)
bool hasMultipleConditionRegisters() const
Return true if multiple condition registers are available.
block Block Frequency true
An instruction for reading from memory.
virtual AtomicExpansionKind shouldExpandAtomicLoadInIR(LoadInst *LI) const
Returns how the given (atomic) load should be expanded by the IR-level AtomicExpand pass...
virtual bool mayBeEmittedAsTailCall(const CallInst *) const
Return true if the target may be able emit the call instruction as a tail call.
virtual bool shouldAvoidTransformToShift(EVT VT, unsigned Amount) const
Return true if creating a shift of the type by the given amount is not profitable.
virtual Register getRegisterByName(const char *RegName, LLT Ty, const MachineFunction &MF) const
Return the register ID of the name passed in.
virtual bool isTypeDesirableForOp(unsigned, EVT VT) const
Return true if the target has native support for the specified value type and it is 'desirable' to us...
[US]{MIN/MAX} - Binary minimum or maximum or signed or unsigned integers.
bool hasExtractBitsInsn() const
Return true if the target has BitExtract instructions.
an instruction that atomically reads a memory location, combines it with another value, and then stores the result back.
BooleanContent getBooleanContents(bool isVec, bool isFloat) const
For targets without i1 registers, this gives the nature of the high-bits of boolean values held in ty...
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
virtual AtomicExpansionKind shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const
Returns how the IR-level AtomicExpand pass should expand the given AtomicRMW, if at all...
virtual Align getABIAlignmentForCallingConv(Type *ArgTy, DataLayout DL) const
Certain targets have context senstive alignment requirements, where one type has the alignment requir...
virtual bool isZExtFree(Type *FromTy, Type *ToTy) const
Return true if any actual instruction that defines a value of type FromTy implicitly zero-extends the...
AtomicExpansionKind
Enum that specifies what an atomic load/AtomicRMWInst is expanded to, if at all.
virtual bool storeOfVectorConstantIsCheap(EVT MemVT, unsigned NumElem, unsigned AddrSpace) const
Return true if it is expected to be cheaper to do a store of a non-zero vector constant with the give...
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...
LegalizeAction getFixedPointOperationAction(unsigned Op, EVT VT, unsigned Scale) const
Some fixed point operations may be natively supported by the target but only for specific scales...
std::pair< LegalizeTypeAction, EVT > LegalizeKind
LegalizeKind holds the legalization kind that needs to happen to EVT in order to type-legalize it...
CallLoweringInfo & setDiscardResult(bool Value=true)
virtual StringRef getStackProbeSymbolName(MachineFunction &MF) const
Returns the name of the symbol used to emit stack probes or the empty string if not applicable...
void setIndexedMaskedLoadAction(unsigned IdxMode, MVT VT, LegalizeAction Action)
Indicate that the specified indexed masked load does or does not work with the specified type and ind...
Align getMinFunctionAlignment() const
Return the minimum function alignment.
virtual bool getTgtMemIntrinsic(IntrinsicInfo &, const CallInst &, MachineFunction &, unsigned) const
Given an intrinsic, checks if on the target the intrinsic will need to map to a MemIntrinsicNode (tou...
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
bool isValid() const
Return true if this is a valid simple valuetype.
bool isCondCodeLegal(ISD::CondCode CC, MVT VT) const
Return true if the specified condition code is legal on this target.
virtual Value * emitMaskedAtomicRMWIntrinsic(IRBuilder<> &Builder, AtomicRMWInst *AI, Value *AlignedAddr, Value *Incr, Value *Mask, Value *ShiftAmt, AtomicOrdering Ord) const
Perform a masked atomicrmw using a target-specific intrinsic.
virtual bool lowerAtomicStoreAsStoreSDNode(const StoreInst &SI) const
Should SelectionDAG lower an atomic store of the given kind as a normal StoreSDNode (as opposed to an...
CallLoweringInfo & setCallee(Type *ResultType, FunctionType *FTy, SDValue Target, ArgListTy &&ArgsList, ImmutableCallSite Call)
void setTruncStoreAction(MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified truncating store does not work with the specified type and indicate what ...
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
virtual bool isFPExtFree(EVT DestVT, EVT SrcVT) const
Return true if an fpext operation is free (for instance, because single-precision floating-point numb...
virtual bool isFreeAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const
Returns true if a cast from SrcAS to DestAS is "cheap", such that e.g.
CallingConv::ID getCallingConv() const
Get the calling convention of the call.
virtual bool isCtlzFast() const
Return true if ctlz instruction is fast.
virtual bool isProfitableToCombineMinNumMaxNum(EVT VT) const
A convenience struct that encapsulates a DAG, and two SDValues for returning information from TargetL...
virtual bool shouldExpandShift(SelectionDAG &DAG, SDNode *N) const
Return true if SHIFT instructions should be expanded to SHIFT_PARTS instructions, and false if a libr...
MVT getRegisterType(MVT VT) const
Return the type of registers that this ValueType will eventually require.
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
unsigned getAllocaAddrSpace() const
virtual LLT getOptimalMemOpLLT(uint64_t, unsigned, unsigned, bool, bool, bool, const AttributeList &) const
LLT returning variant.
bool hasOneUse() const
Return true if there is exactly one use of this node.
bool isBeforeLegalize() const
void setIndexedMaskedStoreAction(unsigned IdxMode, MVT VT, LegalizeAction Action)
Indicate that the specified indexed masked store does or does not work with the specified type and in...
A description of a memory reference used in the backend.
void setMaxAtomicSizeInBitsSupported(unsigned SizeInBits)
Set the maximum atomic operation size supported by the backend.
bool isAfterLegalizeDAG() const
Shift and rotation operations.
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
virtual MVT getRegisterTypeForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT) const
Certain combinations of ABIs, Targets and features require that types are legal for some operations a...
virtual bool isSupportedFixedPointOperation(unsigned Op, EVT VT, unsigned Scale) const
Custom method defined by each target to indicate if an operation which may require a scale is support...
CallLoweringInfo & setVarArg(bool Value=true)
CallLoweringInfo & setChain(SDValue InChain)
RESULT = [US]MULFIX(LHS, RHS, SCALE) - Perform fixed point multiplication on 2 integers with the same...
virtual uint8_t getRepRegClassCostFor(MVT VT) const
Return the cost of the 'representative' register class for the specified value type.
Base class for the full range of assembler expressions which are needed for parsing.
virtual bool useLoadStackGuardNode() const
If this function returns true, SelectionDAGBuilder emits a LOAD_STACK_GUARD node when it is lowering ...
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...
This file contains the simple types necessary to represent the attributes associated with functions a...
virtual bool mergeStoresAfterLegalization(EVT MemVT) const
Allow store merging for the specified type after legalization in addition to before legalization...
void addBypassSlowDiv(unsigned int SlowBitWidth, unsigned int FastBitWidth)
Tells the code generator which bitwidths to bypass.
virtual bool isVectorShiftByScalarCheap(Type *Ty) const
Return true if it's significantly cheaper to shift a vector by a uniform scalar than by an amount whi...
bool isLoadExtLegalOrCustom(unsigned ExtType, EVT ValVT, EVT MemVT) const
Return true if the specified load with extension is legal or custom on this target.
bool hasBigEndianPartOrdering(EVT VT, const DataLayout &DL) const
When splitting a value of the specified type into parts, does the Lo or Hi part come first...
virtual bool shouldUseStrictFP_TO_INT(EVT FpVT, EVT IntVT, bool IsSigned) const
Return true if it is more correct/profitable to use strict FP_TO_INT conversion operations - canonica...
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...
virtual bool convertSetCCLogicToBitwiseLogic(EVT VT) const
Use bitwise logic to make pairs of compares more efficient.
virtual bool isMultiStoresCheaperThanBitsMerge(EVT LTy, EVT HTy) const
Return true if it is cheaper to split the store of a merged int val from a pair of smaller values int...
const DataLayout & getDataLayout() const
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
virtual bool aggressivelyPreferBuildVectorSources(EVT VecVT) const
This file implements a class to represent arbitrary precision integral constant values and operations...
virtual bool isTruncateFree(Type *FromTy, Type *ToTy) const
Return true if it's free to truncate a value of type FromTy to type ToTy.
SmallVector< ISD::InputArg, 32 > Ins
AtomicOrdering
Atomic ordering for LLVM's memory model.
virtual bool ShouldShrinkFPConstant(EVT) const
If true, then instruction selection should seek to shrink the FP constant of the specified type to a ...
Align getMinStackArgumentAlignment() const
Return the minimum stack alignment of an argument.
virtual SDValue prepareVolatileOrAtomicLoad(SDValue Chain, const SDLoc &DL, SelectionDAG &DAG) const
This callback is used to prepare for a volatile or atomic load.
Context object for machine code objects.
virtual void ReplaceNodeResults(SDNode *, SmallVectorImpl< SDValue > &, SelectionDAG &) const
This callback is invoked when a node result type is illegal for the target, and the operation was reg...
InstrTy * getInstruction() const
virtual EVT getOptimalMemOpType(uint64_t, unsigned, unsigned, bool, bool, bool, const AttributeList &) const
Returns the target specific optimal type for load and store operations as a result of memset...
This is a fast-path instruction selection class that generates poor code and doesn't support illegal ...
Class to represent function types.
Type * getType() const
All values are typed, get the type of this value.
MachineFunction & getMachineFunction() const
static cl::opt< unsigned > MaxLoadsPerMemcmpOptSize("max-loads-per-memcmp-opt-size", cl::Hidden, cl::desc("Set maximum number of loads used in expanded memcmp for -Os/Oz"))
virtual const TargetRegisterClass * getRegClassFor(MVT VT, bool isDivergent=false) const
Return the register class that should be used for the specified value type.
unsigned MaxLoadsPerMemcmp
Specify maximum number of load instructions per memcmp call.
virtual bool supportSwiftError() const
Return true if the target supports swifterror attribute.
virtual bool shouldSinkOperands(Instruction *I, SmallVectorImpl< Use *> &Ops) const
Return true if sinking I's operands to the same basic block as I is profitable, e.g.
CallingConv::ID getLibcallCallingConv(RTLIB::Libcall Call) const
Get the CallingConv that should be used for the specified libcall.
void setMinFunctionAlignment(Align Alignment)
Set the target's minimum function alignment.
This contains information for each constraint that we are lowering.
Simple integer binary arithmetic operators.
bool isIndexedMaskedLoadLegal(unsigned IdxMode, EVT VT) const
Return true if the specified indexed load is legal on this target.
SmallVector< ISD::OutputArg, 32 > Outs
virtual bool isCheapToSpeculateCtlz() const
Return true if it is cheap to speculate a call to intrinsic ctlz.
virtual bool hasBitTest(SDValue X, SDValue Y) const
Return true if the target has a bit-test instruction: (X & (1 << Y)) ==/!= 0 This knowledge can be us...
bool isLittleEndian() const
Layout endianness...
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
CallLoweringInfo & setZExtResult(bool Value=true)
BooleanContent getBooleanContents(EVT Type) const
virtual bool shouldSplitFunctionArgumentsAsLittleEndian(const DataLayout &DL) const
For most targets, an LLVM type must be broken down into multiple smaller types.
An instruction for storing to memory.
MVT getRegisterType(LLVMContext &Context, EVT VT) const
Return the type of registers that this ValueType will eventually require.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
virtual const MCExpr * LowerCustomJumpTableEntry(const MachineJumpTableInfo *, const MachineBasicBlock *, unsigned, MCContext &) const
virtual bool isEqualityCmpFoldedWithSignedCmp() const
Return true if instruction generated for equality comparison is folded with instruction generated for...
virtual bool isCheapToSpeculateCttz() const
Return true if it is cheap to speculate a call to intrinsic cttz.
virtual bool lowerInterleavedStore(StoreInst *SI, ShuffleVectorInst *SVI, unsigned Factor) const
Lower an interleaved store to target specific intrinsics.
virtual unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const
void setMinCmpXchgSizeInBits(unsigned SizeInBits)
Sets the minimum cmpxchg or ll/sc size supported by the backend.
Value * getOperand(unsigned i) const
Analysis containing CSE Info
Class to represent pointers.
This class is used to represent ISD::STORE nodes.
void setAttributes(ImmutableCallSite *CS, unsigned ArgIdx)
static cl::opt< unsigned > MaxLoadsPerMemcmp("max-loads-per-memcmp", cl::Hidden, cl::desc("Set maximum number of loads used in expanded memcmp"))
void setPrefFunctionAlignment(Align Alignment)
Set the target's preferred function alignment.
bool isJumpExpensive() const
Return true if Flow Control is an expensive operation that should be avoided.
Flag
These should be considered private to the implementation of the MCInstrDesc class.
virtual bool canCombineStoreAndExtract(Type *VectorTy, Value *Idx, unsigned &Cost) const
Return true if the target can combine store(extractelement VectorTy, Idx).
virtual bool alignLoopsWithOptSize() const
Should loops be aligned even when the function is marked OptSize (but not MinSize).
void setPrefLoopAlignment(Align Alignment)
Set the target's preferred loop alignment.
static SDValue scalarizeVectorStore(StoreSDNode *Store, MVT StoreVT, SelectionDAG &DAG)
Scalarize a vector store, bitcasting to TargetVT to determine the scalar type.
virtual Value * emitStoreConditional(IRBuilder<> &Builder, Value *Val, Value *Addr, AtomicOrdering Ord) const
Perform a store-conditional operation to Addr.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
EVT getTypeToExpandTo(LLVMContext &Context, EVT VT) const
For types supported by the target, this is an identity function.
SmallVector< SDValue, 4 > InVals
std::vector< AsmOperandInfo > AsmOperandInfoVector
virtual bool shouldFormOverflowOp(unsigned Opcode, EVT VT) const
Try to convert math with an overflow comparison into the corresponding DAG node operation.
MVT getSimpleValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the MVT corresponding to this LLVM type. See getValueType.
virtual bool getAddrModeArguments(IntrinsicInst *, SmallVectorImpl< Value *> &, Type *&) const
CodeGenPrepare sinks address calculations into the same BB as Load/Store instructions reading the add...
unsigned const MachineRegisterInfo * MRI
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
virtual unsigned getExceptionPointerRegister(const Constant *PersonalityFn) const
If a physical register, this returns the register that receives the exception address on entry to an ...
DAGCombinerInfo(SelectionDAG &dag, CombineLevel level, bool cl, void *dc)
CallLoweringInfo & setIsPatchPoint(bool Value=true)
The instances of the Type class are immutable: once they are created, they are never changed...
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...
Simple binary floating point operators.
MakeLibCallOptions & setDiscardResult(bool Value=true)
void setTargetDAGCombine(ISD::NodeType NT)
Targets should invoke this method for each target independent node that they want to provide a custom...
virtual Value * emitMaskedAtomicCmpXchgIntrinsic(IRBuilder<> &Builder, AtomicCmpXchgInst *CI, Value *AlignedAddr, Value *CmpVal, Value *NewVal, Value *Mask, AtomicOrdering Ord) const
Perform a masked cmpxchg using a target-specific intrinsic.
virtual bool isTruncateFree(EVT FromVT, EVT ToVT) const
virtual ISD::NodeType getExtendForAtomicOps() const
Returns how the platform's atomic operations are extended (ZERO_EXTEND, SIGN_EXTEND, or ANY_EXTEND).
This is an important base class in LLVM.
virtual bool shouldConvertConstantLoadToIntImm(const APInt &Imm, Type *Ty) const
Return true if it is beneficial to convert a load of a constant to just the constant itself...
bool isFloatingPointOperation() const
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
virtual bool allowsMisalignedMemoryAccesses(EVT, unsigned AddrSpace=0, unsigned Align=1, MachineMemOperand::Flags Flags=MachineMemOperand::MONone, bool *=nullptr) const
Determine if the target supports unaligned memory accesses.
Carry-using nodes for multiple precision addition and subtraction.
bool isSlowDivBypassed() const
Returns true if target has indicated at least one type should be bypassed.
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
virtual Value * emitLoadLinked(IRBuilder<> &Builder, Value *Addr, AtomicOrdering Ord) const
Perform a load-linked operation on Addr, returning a "Value *" with the corresponding pointee type...
virtual SDValue unwrapAddress(SDValue N) const
bool IsPostTypeLegalization
void setBooleanContents(BooleanContent Ty)
Specify how the target extends the result of integer and floating point boolean values from i1 to a w...
bool isAcquireOrStronger(AtomicOrdering ao)
virtual SDValue emitStackGuardXorFP(SelectionDAG &DAG, SDValue Val, const SDLoc &DL) const
virtual LoadInst * lowerIdempotentRMWIntoFencedLoad(AtomicRMWInst *RMWI) const
On some platforms, an AtomicRMW that never actually modifies the value (such as fetch_add of 0) can b...
virtual Align getPrefLoopAlignment(MachineLoop *ML=nullptr) const
Return the preferred loop alignment.
virtual unsigned getExceptionSelectorRegister(const Constant *PersonalityFn) const
If a physical register, this returns the register that receives the exception typeid on entry to a la...
LegalizeAction getCondCodeAction(ISD::CondCode CC, MVT VT) const
Return how the condition code should be treated: either it is legal, needs to be expanded to some oth...
virtual bool areJTsAllowed(const Function *Fn) const
Return true if lowering to a jump table is allowed.
void setOperationPromotedToType(unsigned Opc, MVT OrigVT, MVT DestVT)
Convenience method to set an operation to Promote and specify the type in a single call...
bool CombineTo(SDValue O, SDValue N)
MVT getPointerMemTy(const DataLayout &DL, uint32_t AS=0) const
Return the in-memory pointer type for the given address space, defaults to the pointer type from the ...
bool isOperationLegalOrCustomOrPromote(unsigned Op, EVT VT) const
Return true if the specified operation is legal on this target or can be made legal with custom lower...
virtual bool targetShrinkDemandedConstant(SDValue Op, const APInt &Demanded, TargetLoweringOpt &TLO) const
virtual bool ExpandInlineAsm(CallInst *) const
This hook allows the target to expand an inline asm call to be explicit llvm code if it wants to...
virtual bool hasPairedLoad(EVT, unsigned &) const
Return true if the target supplies and combines to a paired load two loaded values of type LoadedType...
virtual MVT getFenceOperandTy(const DataLayout &DL) const
Return the type for operands of fence.
virtual bool isDesirableToCombineBuildVectorToShuffleTruncate(ArrayRef< int > ShuffleMask, EVT SrcVT, EVT TruncVT) const
bool isIndexedLoadLegal(unsigned IdxMode, EVT VT) const
Return true if the specified indexed load is legal on this target.
bool isOperationLegal(unsigned Op, EVT VT) const
Return true if the specified operation is legal on this target.
virtual bool isDesirableToTransformToIntegerOp(unsigned, EVT) const
Return true if it is profitable for dag combiner to transform a floating point op of specified opcode...
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 bool isSExtCheaperThanZExt(EVT FromTy, EVT ToTy) const
Return true if sign-extension from FromTy to ToTy is cheaper than zero-extension. ...
virtual bool isProfitableToHoist(Instruction *I) const
bool supportsUnalignedAtomics() const
Whether the target supports unaligned atomic operations.
virtual bool hasVectorBlend() const
Return true if the target has a vector blend instruction.
virtual EVT getTypeForExtReturn(LLVMContext &Context, EVT VT, ISD::NodeType) const
Return the type that should be used to zero or sign extend a zeroext/signext integer return value...
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...
static unsigned NumFixedArgs
std::vector< ArgListEntry > ArgListTy
virtual bool functionArgumentNeedsConsecutiveRegisters(Type *Ty, CallingConv::ID CallConv, bool isVarArg) const
For some targets, an LLVM struct type must be broken down into multiple simple types, but the calling convention specifies that the entire struct must be passed in a block of consecutive registers.
virtual bool allowTruncateForTailCall(Type *FromTy, Type *ToTy) const
Return true if a truncation from FromTy to ToTy is permitted when deciding whether a call is in tail ...
static constexpr const Align None()
Returns a default constructed Align which corresponds to no alignment.
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.
virtual Sched::Preference getSchedulingPreference(SDNode *) const
Some scheduler, e.g.
This structure contains all information that is necessary for lowering calls.
virtual bool isUsedByReturnOnly(SDNode *, SDValue &) const
Return true if result of the specified node is used by a return node only.
bool isBeforeLegalizeOps() const
bool isExtFree(const Instruction *I) const
Return true if the extension represented by I is free.
const TargetMachine & getTargetMachine() const
virtual bool useStackGuardXorFP() const
If this function returns true, stack protection checks should XOR the frame pointer (or whichever poi...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void setLibcallCallingConv(RTLIB::Libcall Call, CallingConv::ID CC)
Set the CallingConv that should be used for the specified libcall.
AsmOperandInfo(InlineAsm::ConstraintInfo Info)
Copy constructor for copying from a ConstraintInfo.
EVT getValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the EVT corresponding to this LLVM type.
std::string ConstraintCode
This contains the actual string for the code, like "m".
virtual Instruction * emitLeadingFence(IRBuilder<> &Builder, Instruction *Inst, AtomicOrdering Ord) const
Inserts in the IR a target-specific intrinsic specifying a fence.
unsigned getMaxAtomicSizeInBitsSupported() const
Returns the maximum atomic operation size (in bits) supported by the backend.
This struct is a compact representation of a valid (non-zero power of two) alignment.
unsigned GatherAllAliasesMaxDepth
Depth that GatherAllAliases should should continue looking for chain dependencies when trying to find...
bool isInTailCallPosition(ImmutableCallSite CS, const TargetMachine &TM)
Test if the given instruction is in a position to be optimized with a tail-call.
Triple - Helper class for working with autoconf configuration names.
unsigned getMaxStoresPerMemcpy(bool OptSize) const
Get maximum # of store operations permitted for llvm.memcpy.
virtual bool isFPExtFoldable(const SelectionDAG &DAG, unsigned Opcode, EVT DestVT, EVT SrcVT) const
Return true if an fpext operation input to an Opcode operation is free (for instance, because half-precision floating-point numbers are implicitly extended to float-precision) for an FMA instruction.
This base class for TargetLowering contains the SelectionDAG-independent parts that can be used from ...
virtual const MCPhysReg * getScratchRegisters(CallingConv::ID CC) const
Returns a 0 terminated array of registers that can be safely used as scratch registers.
void setCmpLibcallCC(RTLIB::Libcall Call, ISD::CondCode CC)
Override the default CondCode to be used to test the result of the comparison libcall against zero...
virtual bool shouldScalarizeBinop(SDValue VecOp) const
Try to convert an extract element of a vector binary operation into an extract element followed by a ...
virtual bool isExtFreeImpl(const Instruction *I) const
Return true if the extension represented by I is free.
void setHasExtractBitsInsn(bool hasExtractInsn=true)
Tells the code generator that the target has BitExtract instructions.
bool isReleaseOrStronger(AtomicOrdering ao)
void GetReturnInfo(CallingConv::ID CC, Type *ReturnType, AttributeList attr, SmallVectorImpl< ISD::OutputArg > &Outs, const TargetLowering &TLI, const DataLayout &DL)
Given an LLVM IR type and return type attributes, compute the return value EVTs and flags...
LegalizeAction
This enum indicates whether operations are valid for a target, and if not, what action should be used...
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
virtual MVT hasFastEqualityCompare(unsigned NumBits) const
Return the preferred operand type if the target has a quick way to compare integer values of the give...
RESULT = [US]ADDSAT(LHS, RHS) - Perform saturation addition on 2 integers with the same bit width (W)...
virtual bool IsDesirableToPromoteOp(SDValue, EVT &) const
This method query the target whether it is beneficial for dag combiner to promote the specified node...
const TargetLowering & getTargetLoweringInfo() const
Align getPrefFunctionAlignment() const
Return the preferred function alignment.
virtual bool supportSplitCSR(MachineFunction *MF) const
Return true if the target supports that a subset of CSRs for the given machine function is handled ex...
virtual unsigned getNumRegistersForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT) const
Certain targets require unusual breakdowns of certain types.
static const int LAST_LOADEXT_TYPE
CCState - This class holds information needed while lowering arguments and return values...
virtual void initializeSplitCSR(MachineBasicBlock *Entry) const
Perform necessary initialization to handle a subset of CSRs explicitly via copies.
virtual bool preferIncOfAddToSubOfNot(EVT VT) const
These two forms are equivalent: sub y, (xor x, -1) add (add x, 1), y The variant with two add's is IR...
ReciprocalEstimate
Reciprocal estimate status values used by the functions below.
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.
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.
virtual bool shouldNormalizeToSelectSequence(LLVMContext &Context, EVT VT) const
Returns true if we should normalize select(N0&N1, X, Y) => select(N0, select(N1, X, Y), Y) and select(N0|N1, X, Y) => select(N0, select(N1, X, Y, Y)) if it is likely that it saves us from materializing N0 and N1 in an integer register.
virtual bool getPostIndexedAddressParts(SDNode *, SDNode *, SDValue &, SDValue &, ISD::MemIndexedMode &, SelectionDAG &) const
Returns true by value, base pointer and offset pointer and addressing mode by reference if this node ...
virtual const char * getClearCacheBuiltinName() const
Return the builtin name for the __builtin___clear_cache intrinsic Default is to invoke the clear cach...
This struct is a compact representation of a valid (power of two) or undefined (0) alignment...
virtual bool lowerInterleavedLoad(LoadInst *LI, ArrayRef< ShuffleVectorInst *> Shuffles, ArrayRef< unsigned > Indices, unsigned Factor) const
Lower an interleaved load to target specific intrinsics.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
virtual unsigned getMaxSupportedInterleaveFactor() const
Get the maximum supported factor for interleaved memory accesses.
CallLoweringInfo & setCallee(CallingConv::ID CC, Type *ResultType, SDValue Target, ArgListTy &&ArgsList)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
virtual bool isExtractSubvectorCheap(EVT ResVT, EVT SrcVT, unsigned Index) const
Return true if EXTRACT_SUBVECTOR is cheap for extracting this result type from this source type with ...
MakeLibCallOptions & setSExt(bool Value=true)
Provides information about what library functions are available for the current target.
virtual bool shouldConsiderGEPOffsetSplit() const
TargetLoweringOpt(SelectionDAG &InDAG, bool LT, bool LO)
virtual bool isZExtFree(EVT FromTy, EVT ToTy) const
constexpr size_t array_lengthof(T(&)[N])
Find the length of an array.
virtual bool shouldFoldMaskToVariableShiftPair(SDValue X) const
There are two ways to clear extreme bits (either low or high): Mask: x & (-1 << y) (the instcombine c...
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
FMINNUM_IEEE/FMAXNUM_IEEE - Perform floating-point minimum or maximum on two values, following the IEEE-754 2008 definition.
LegalizeAction getOperationAction(unsigned Op, EVT VT) const
Return how this operation should be treated: either it is legal, needs to be promoted to a larger siz...
const DenseMap< unsigned int, unsigned int > & getBypassSlowDivWidths() const
Returns map of slow types for division or remainder with corresponding fast types.
virtual bool isVectorLoadExtDesirable(SDValue ExtVal) const
Return true if folding a vector load into ExtVal (a sign, zero, or any extend node) is profitable...
bool rangeFitsInWord(const APInt &Low, const APInt &High, const DataLayout &DL) const
Check whether the range [Low,High] fits in a machine word.
virtual bool requiresUniformRegister(MachineFunction &MF, const Value *) const
Allows target to decide about the register class of the specific value that is live outside the defin...
virtual bool isLoadBitCastBeneficial(EVT LoadVT, EVT BitcastVT, const SelectionDAG &DAG, const MachineMemOperand &MMO) const
Return true if the following transform is beneficial: fold (conv (load x)) -> (load (conv*)x) On arch...
virtual bool isZExtFree(SDValue Val, EVT VT2) const
Return true if zero-extending the specific node Val to type VT2 is free (either because it's implicit...
bool isCalledByLegalizer() const
bool isTruncStoreLegalOrCustom(EVT ValVT, EVT MemVT) const
Return true if the specified store with truncation has solution on this target.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
void setHasMultipleConditionRegisters(bool hasManyRegs=true)
Tells the code generator that the target has multiple (allocatable) condition registers that can be u...
CallLoweringInfo & setSExtResult(bool Value=true)
Represents one node in the SelectionDAG.
MakeLibCallOptions & setNoReturn(bool Value=true)
virtual bool allowsMisalignedMemoryAccesses(LLT, unsigned AddrSpace=0, unsigned Align=1, MachineMemOperand::Flags Flags=MachineMemOperand::MONone, bool *=nullptr) const
LLT handling variant.
LegalizeAction getTruncStoreAction(EVT ValVT, EVT MemVT) const
Return how this store with truncation should be treated: either it is legal, needs to be promoted to ...
ArrayRef< EVT > OpsVTBeforeSoften
bool enableExtLdPromotion() const
Return true if the target wants to use the optimization that turns ext(promotableInst1(...(promotableInstN(load)))) into promotedInst1(...(promotedInstN(ext(load)))).
Class to represent vector types.
static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements, bool IsScalable=false)
Returns the EVT that represents a vector NumElements in length, where each element is of type VT...
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...
Target - Wrapper for Target specific information.
bool isTypeLegal(EVT VT) const
Return true if the target has native support for the specified value type.
Class for arbitrary precision integers.
virtual unsigned getVaListSizeInBits(const DataLayout &DL) const
Returns the size of the platform's va_list object.
virtual bool isFMAFasterThanFMulAndFAdd(const MachineFunction &MF, EVT) const
Return true if an FMA operation is faster than a pair of fmul and fadd instructions.
virtual bool hasAndNot(SDValue X) const
Return true if the target has a bitwise and-not operation: X = ~A & B This can be used to simplify se...
LegalizeTypeAction getTypeAction(MVT VT) const
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
unsigned getMaxExpandSizeMemcmp(bool OptSize) const
Get maximum # of load operations permitted for memcmp.
ZERO_EXTEND - Used for integer types, zeroing the new bits.
virtual SDValue LowerFormalArguments(SDValue, CallingConv::ID, bool, const SmallVectorImpl< ISD::InputArg > &, const SDLoc &, SelectionDAG &, SmallVectorImpl< SDValue > &) const
This hook must be implemented to lower the incoming (formal) arguments, described by the Ins array...
ANY_EXTEND - Used for integer types. The high bits are undefined.
MulExpansionKind
Enum that specifies when a multiplication should be expanded.
virtual bool needsFixedCatchObjects() const
Flags
Flags values. These may be or'd together.
MVT getTypeToPromoteTo(unsigned Op, MVT VT) const
If the action for this operation is to promote, this method returns the ValueType to promote to...
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
virtual bool hasAndNotCompare(SDValue Y) const
Return true if the target should transform: (X & Y) == Y —> (~X & Y) == 0 (X & Y) != Y —> (~X & Y) ...
virtual bool hasStandaloneRem(EVT VT) const
Return true if the target can handle a standalone remainder operation.
virtual bool useSoftFloat() const
CallLoweringInfo & setTailCall(bool Value=true)
virtual bool isLegalICmpImmediate(int64_t) const
Return true if the specified immediate is legal icmp immediate, that is the target has icmp instructi...
virtual bool shouldProduceAndByConstByHoistingConstFromShiftsLHSOfAnd(SDValue X, ConstantSDNode *XC, ConstantSDNode *CC, SDValue Y, unsigned OldShiftOpcode, unsigned NewShiftOpcode, SelectionDAG &DAG) const
Given the pattern (X & (C l>>/<< Y)) ==/!= 0 return true if it should be transformed into: ((X <</l>> Y) ...
BR_JT - Jumptable branch.
Representation of each machine instruction.
virtual bool isFPImmLegal(const APFloat &, EVT, bool ForCodeSize=false) const
Returns true if the target can instruction select the specified FP immediate natively.
LegalizeAction getIndexedMaskedStoreAction(unsigned IdxMode, MVT VT) const
Return how the indexed store should be treated: either it is legal, needs to be promoted to a larger ...
virtual bool isDesirableToCommuteWithShift(const SDNode *N, CombineLevel Level) const
Return true if it is profitable to move this shift by a constant amount though its operand...
CallLoweringInfo & setConvergent(bool Value=true)
SmallVector< SDValue, 32 > OutVals
bool isVector() const
Return true if this is a vector value type.
virtual bool convertSelectOfConstantsToMath(EVT VT) const
Return true if a select of constants (select Cond, C1, C2) should be transformed into simple math ops...
Bitwise operators - logical and, logical or, logical xor.
FenceInst * CreateFence(AtomicOrdering Ordering, SyncScope::ID SSID=SyncScope::System, const Twine &Name="")
block Block Frequency Analysis
virtual bool isSDNodeSourceOfDivergence(const SDNode *N, FunctionLoweringInfo *FLI, LegacyDivergenceAnalysis *DA) const
SelectSupportKind
Enum that describes what type of support for selects the target has.
virtual SDValue LowerCall(CallLoweringInfo &, SmallVectorImpl< SDValue > &) const
This hook must be implemented to lower calls into the specified DAG.
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
const ValueTypeActionImpl & getValueTypeActions() const
StringRef getValueAsString() const
Return the attribute's value as a string.
void setTypeAction(MVT VT, LegalizeTypeAction Action)
bool isPositionIndependent() const
virtual void insertCopiesSplitCSR(MachineBasicBlock *Entry, const SmallVectorImpl< MachineBasicBlock *> &Exits) const
Insert explicit copies in entry and exit blocks.
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
Establish a view to a call site for examination.
LegalizeTypeAction getTypeAction(LLVMContext &Context, EVT VT) const
Return how we should legalize values of this type, either it is already legal (return 'Legal') or we ...
virtual SDValue getRecipEstimate(SDValue Operand, SelectionDAG &DAG, int Enabled, int &RefinementSteps) const
Return a reciprocal estimate value for the input operand.
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
unsigned MaxStoresPerMemmoveOptSize
Likewise for functions with the OptSize attribute.
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.
ISD::CondCode getCmpLibcallCC(RTLIB::Libcall Call) const
Get the CondCode that's to be used to test the result of the comparison libcall against zero...
virtual void emitAtomicCmpXchgNoStoreLLBalance(IRBuilder<> &Builder) const
void setLibcallName(RTLIB::Libcall Call, const char *Name)
Rename the default libcall routine name for the specified libcall.
unsigned getMinCmpXchgSizeInBits() const
Returns the size of the smallest cmpxchg or ll/sc instruction the backend supports.
virtual bool decomposeMulByConstant(LLVMContext &Context, EVT VT, SDValue C) const
Return true if it is profitable to transform an integer multiplication-by-constant into simpler opera...
static const int LAST_INDEXED_MODE
virtual bool shouldExpandAtomicStoreInIR(StoreInst *SI) const
Returns true if the given (atomic) store should be expanded by the IR-level AtomicExpand pass into an...
unsigned MaxStoresPerMemcpy
Specify maximum number of store instructions per memcpy call.
virtual bool isFMAFasterThanFMulAndFAdd(const Function &F, Type *) const
IR version.
virtual MachineMemOperand::Flags getMMOFlags(const Instruction &I) const
This callback is used to inspect load/store instructions and add target-specific MachineMemOperand fl...
virtual bool isIntDivCheap(EVT VT, AttributeList Attr) const
Return true if integer divide is usually cheaper than a sequence of several shifts, adds, and multiplies for this target.
void setMinStackArgumentAlignment(Align Alignment)
Set the minimum stack alignment of an argument.
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
unsigned getNumRegisters(LLVMContext &Context, EVT VT) const
Return the number of registers that this ValueType will eventually require.
bool isInvoke() const
Return true if a InvokeInst is enclosed.
LegalizeAction getIndexedMaskedLoadAction(unsigned IdxMode, MVT VT) const
Return how the indexed load should be treated: either it is legal, needs to be promoted to a larger s...
EVT getMemValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
bool isIndexedMaskedStoreLegal(unsigned IdxMode, EVT VT) const
Return true if the specified indexed load is legal on this target.
virtual bool isStoreBitCastBeneficial(EVT StoreVT, EVT BitcastVT, const SelectionDAG &DAG, const MachineMemOperand &MMO) const
Return true if the following transform is beneficial: (store (y (conv x)), y*)) -> (store x...
void setSupportsUnalignedAtomics(bool UnalignedSupported)
Sets whether unaligned atomic operations are supported.
virtual bool reduceSelectOfFPConstantLoads(EVT CmpOpVT) const
Return true if it is profitable to convert a select of FP constants into a constant pool load whose a...
virtual bool isIndexingLegal(MachineInstr &MI, Register Base, Register Offset, bool IsPre, MachineRegisterInfo &MRI) const
Returns true if the specified base+offset is a legal indexed addressing mode for this target...
unsigned getMaxStoresPerMemmove(bool OptSize) const
Get maximum # of store operations permitted for llvm.memmove.
LegalizeAction getStrictFPOperationAction(unsigned Op, EVT VT) const
LegalizeAction getIndexedLoadAction(unsigned IdxMode, MVT VT) const
Return how the indexed load should be treated: either it is legal, needs to be promoted to a larger s...
bool EnableExtLdPromotion
bool hasAtomicStore() const
Return true if this atomic instruction stores to memory.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LegalizeTypeAction
This enum indicates whether a types are legal for a target, and if not, what action should be used to...
bool isFloat(MCInstrInfo const &MCII, MCInst const &MCI)
Return whether it is a floating-point insn.
virtual bool shouldFoldConstantShiftPairToMask(const SDNode *N, CombineLevel Level) const
Return true if it is profitable to fold a pair of shifts into a mask.
virtual bool CanLowerReturn(CallingConv::ID, MachineFunction &, bool, const SmallVectorImpl< ISD::OutputArg > &, LLVMContext &) const
This hook should be implemented to check whether the return values described by the Outs array can fi...
void setSchedulingPreference(Sched::Preference Pref)
Specify the target scheduling preference.
CallLoweringInfo & setInRegister(bool Value=true)
virtual bool isBinOp(unsigned Opcode) const
Return true if the node is a math/logic binary operator.
LLVM Value Representation.
Fast - This calling convention attempts to make calls as fast as possible (e.g.
virtual FastISel * createFastISel(FunctionLoweringInfo &, const TargetLibraryInfo *) const
This method returns a target specific FastISel object, or null if the target does not support "fast" ...
bool doesNotReturn() const
Determine if the call cannot return.
unsigned getStackPointerRegisterToSaveRestore() const
If a physical register, this specifies the register that llvm.savestack/llvm.restorestack should save...
virtual bool isVectorClearMaskLegal(ArrayRef< int >, EVT) const
Similar to isShuffleMaskLegal.
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.
static bool ShrinkDemandedConstant(Instruction *I, unsigned OpNo, const APInt &Demanded)
Check to see if the specified operand of the specified instruction is a constant integer.
virtual bool isFsqrtCheap(SDValue X, SelectionDAG &DAG) const
Return true if SQRT(X) shouldn't be replaced with X*RSQRT(X).
bool isOperationLegalOrPromote(unsigned Op, EVT VT) const
Return true if the specified operation is legal on this target or can be made legal using promotion...
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
virtual bool shouldExpandBuildVectorWithShuffles(EVT, unsigned DefinedValues) const
MVT getFrameIndexTy(const DataLayout &DL) const
Return the type for frame index, which is determined by the alloca address space specified through th...
bool isLoadExtLegal(unsigned ExtType, EVT ValVT, EVT MemVT) const
Return true if the specified load with extension is legal on this target.
bool isCondCodeLegalOrCustom(ISD::CondCode CC, MVT VT) const
Return true if the specified condition code is legal or custom on this target.
CallLoweringInfo(SelectionDAG &DAG)
Primary interface to the complete machine description for the target machine.
virtual int getScalingFactorCost(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS=0) const
Return the cost of the scaling factor used in the addressing mode represented by AM for this target...
bool hasOneUse() const
Return true if there is exactly one user of this value.
StringRef - Represent a constant reference to a string, i.e.
FMAD - Perform a * b + c, while getting the same result as the separately rounded operations...
unsigned MaxStoresPerMemset
Specify maximum number of store instructions per memset call.
unsigned MaxStoresPerMemsetOptSize
Likewise for functions with the OptSize attribute.
virtual bool isShuffleMaskLegal(ArrayRef< int >, EVT) const
Targets can use this to indicate that they only support some VECTOR_SHUFFLE operations, those with specific masks.
BooleanContent
Enum that describes how the target represents true/false values.
unsigned getGatherAllAliasesMaxDepth() const
virtual bool isFMADLegalForFAddFSub(const SelectionDAG &DAG, const SDNode *N) const
Returns true if the FADD or FSUB node passed could legally be combined with an fmul to form an ISD::F...
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
bool hasTargetDAGCombine(ISD::NodeType NT) const
If true, the target has custom DAG combine transformations that it can perform for the specified node...
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
virtual bool hasBitPreservingFPLogic(EVT VT) const
Return true if it is safe to transform an integer-domain bitwise operation into the equivalent floati...
virtual unsigned getMaxGluedStoresPerMemcpy() const
Get maximum # of store operations to be glued together.
RESULT = [US]DIVFIX(LHS, RHS, SCALE) - Perform fixed point division on 2 integers with the same width...
virtual SDValue LowerReturn(SDValue, CallingConv::ID, bool, const SmallVectorImpl< ISD::OutputArg > &, const SmallVectorImpl< SDValue > &, const SDLoc &, SelectionDAG &) const
This hook must be implemented to lower outgoing return values, described by the Outs array...
virtual bool shouldAlignPointerArgs(CallInst *, unsigned &, unsigned &) const
Return true if the pointer arguments to CI should be aligned by aligning the object whose address is ...
virtual bool shouldTransformSignedTruncationCheck(EVT XVT, unsigned KeptBits) const
Should we tranform the IR-optimal check for whether given truncation down into KeptBits would be trun...
virtual TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const
Return the preferred vector type legalization action.
EVT getTypeToTransformTo(LLVMContext &Context, EVT VT) const
For types supported by the target, this is an identity function.
virtual bool isLegalAddImmediate(int64_t) const
Return true if the specified immediate is legal add immediate, that is the target has add instruction...
virtual bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const
Returns true if a cast between SrcAS and DestAS is a noop.
The operation is expected to be selectable directly by the target, and no transformation is necessary...
virtual bool shouldSignExtendTypeInLibCall(EVT Type, bool IsSigned) const
Returns true if arguments should be sign-extended in lib calls.
bool isExtended() const
Test if the given EVT is extended (as opposed to being simple).
void setBooleanContents(BooleanContent IntTy, BooleanContent FloatTy)
Specify how the target extends the result of integer and floating point boolean values from i1 to a w...
LLVMContext * getContext() const
virtual bool isSDNodeAlwaysUniform(const SDNode *N) const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
bool isOperationExpand(unsigned Op, EVT VT) const
Return true if the specified operation is illegal on this target or unlikely to be made legal with cu...
CallLoweringInfo & setLibCallee(CallingConv::ID CC, Type *ResultType, SDValue Target, ArgListTy &&ArgsList)
bool PredictableSelectIsExpensive
Tells the code generator that select is more expensive than a branch if the branch is usually predict...
bool isIndexedStoreLegal(unsigned IdxMode, EVT VT) const
Return true if the specified indexed load is legal on this target.
Wrapper class representing virtual and physical registers.
LegalizeTypeAction getTypeAction(MVT VT) const
virtual bool isNarrowingProfitable(EVT, EVT) const
Return true if it's profitable to narrow operations of type VT1 to VT2.
A wrapper class for inspecting calls to intrinsic functions.
virtual bool isFAbsFree(EVT VT) const
Return true if an fabs operation is free to the point where it is never worthwhile to replace it with...
virtual bool isLegalStoreImmediate(int64_t Value) const
Return true if the specified immediate is legal for the value input of a store instruction.
const char * getLibcallName(RTLIB::Libcall Call) const
Get the libcall routine name for the specified libcall.
virtual bool shouldSplatInsEltVarIndex(EVT) const
Return true if inserting a scalar into a variable element of an undef vector is more efficiently hand...
virtual Instruction * emitTrailingFence(IRBuilder<> &Builder, Instruction *Inst, AtomicOrdering Ord) const
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 ...
static const char * LibcallRoutineNames[]
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
This class is used to represent ISD::LOAD nodes.
bool isPredictableSelectExpensive() const
Return true if selects are only cheaper than branches if the branch is unlikely to be predicted right...
bool isExtLoad(const LoadInst *Load, const Instruction *Ext, const DataLayout &DL) const
Return true if Load and Ext can form an ExtLoad.