14#ifndef LLVM_ANALYSIS_TARGETTRANSFORMINFOIMPL_H
15#define LLVM_ANALYSIS_TARGETTRANSFORMINFOIMPL_H
58 Type *AccessType)
const {
82 return SI.getNumCases();
162 virtual std::pair<KnownBits, KnownBits>
166 "expected pointer or pointer vector type");
169 if (
DL.isNonIntegralAddressSpace(FromAS))
170 return std::pair(
KnownBits(
DL.getPointerSizeInBits(FromAS)),
176 CastI->getDestAddressSpace(), *CastI->getPointerOperand());
177 FromPtrBits = KB.second;
185 return {FromPtrBits, ToPtrBits};
191 unsigned ToASBitSize =
DL.getPointerSizeInBits(ToAS);
193 if (
DL.isNonIntegralAddressSpace(FromAS))
203 unsigned DstAS)
const {
204 return {
DL.getPointerSizeInBits(SrcAS), 0};
214 virtual std::pair<const Value *, unsigned>
216 return std::make_pair(
nullptr, -1);
226 assert(
F &&
"A concrete function must be provided to this routine.");
233 if (
F->isIntrinsic())
236 if (
F->hasLocalLinkage() || !
F->hasName())
243 if (Name ==
"copysign" || Name ==
"copysignf" || Name ==
"copysignl" ||
244 Name ==
"fabs" || Name ==
"fabsf" || Name ==
"fabsl" ||
245 Name ==
"fmin" || Name ==
"fminf" || Name ==
"fminl" ||
246 Name ==
"fmax" || Name ==
"fmaxf" || Name ==
"fmaxl" ||
247 Name ==
"sin" || Name ==
"sinf" || Name ==
"sinl" ||
248 Name ==
"cos" || Name ==
"cosf" || Name ==
"cosl" ||
249 Name ==
"tan" || Name ==
"tanf" || Name ==
"tanl" ||
250 Name ==
"asin" || Name ==
"asinf" || Name ==
"asinl" ||
251 Name ==
"acos" || Name ==
"acosf" || Name ==
"acosl" ||
252 Name ==
"atan" || Name ==
"atanf" || Name ==
"atanl" ||
253 Name ==
"atan2" || Name ==
"atan2f" || Name ==
"atan2l"||
254 Name ==
"sinh" || Name ==
"sinhf" || Name ==
"sinhl" ||
255 Name ==
"cosh" || Name ==
"coshf" || Name ==
"coshl" ||
256 Name ==
"tanh" || Name ==
"tanhf" || Name ==
"tanhl" ||
257 Name ==
"sqrt" || Name ==
"sqrtf" || Name ==
"sqrtl" ||
258 Name ==
"exp10" || Name ==
"exp10l" || Name ==
"exp10f")
262 if (Name ==
"pow" || Name ==
"powf" || Name ==
"powl" || Name ==
"exp2" ||
263 Name ==
"exp2l" || Name ==
"exp2f" || Name ==
"floor" ||
264 Name ==
"floorf" || Name ==
"ceil" || Name ==
"round" ||
265 Name ==
"ffs" || Name ==
"ffsl" || Name ==
"abs" || Name ==
"labs" ||
289 virtual std::optional<Instruction *>
294 virtual std::optional<Value *>
297 bool &KnownBitsComputed)
const {
305 SimplifyAndSetOp)
const {
323 const APInt &)
const {
328 int64_t BaseOffset,
bool HasBaseReg,
329 int64_t Scale,
unsigned AddrSpace,
331 int64_t ScalableOffset = 0)
const {
334 return !BaseGV && BaseOffset == 0 && (Scale == 0 || Scale == 1);
339 return std::tie(
C1.NumRegs,
C1.AddRecCost,
C1.NumIVMuls,
C1.NumBaseAdds,
340 C1.ScaleCost,
C1.ImmCost,
C1.SetupCost) <
386 unsigned DataSize =
DL.getTypeStoreSize(DataType);
393 unsigned DataSize =
DL.getTypeStoreSize(DataType);
411 Align Alignment)
const {
416 Align Alignment)
const {
421 Align Alignment)
const {
443 std::optional<Instruction::CastOps> CastHint)
const {
449 unsigned AddrSpace)
const {
454 Type *DataType)
const {
472 bool HasBaseReg, int64_t Scale,
473 unsigned AddrSpace)
const {
476 Scale, AddrSpace,
nullptr,
488 virtual bool useAA()
const {
return false; }
509 unsigned ScalarOpdIdx)
const {
584 unsigned *
Fast)
const {
635 Type *Ty =
nullptr)
const {
642 return "Generic::Unknown Register Class";
644 return "Generic::ScalarRC";
646 return "Generic::VectorRC";
674 Type *ElementTy)
const {
682 virtual unsigned getMaximumVF(
unsigned ElemWidth,
unsigned Opcode)
const {
691 const Instruction &
I,
bool &AllowPromotionWithoutCommonHeader)
const {
692 AllowPromotionWithoutCommonHeader =
false;
697 virtual std::optional<unsigned>
708 virtual std::optional<unsigned>
724 unsigned NumStridedMemAccesses,
725 unsigned NumPrefetches,
726 bool HasCall)
const {
734 unsigned Opcode,
Type *InputTypeA,
Type *InputTypeB,
Type *AccumType,
742 bool HasUnorderedReductions)
const {
754 auto IsWidenableCondition = [](
const Value *
V) {
756 if (
II->getIntrinsicID() == Intrinsic::experimental_widenable_condition)
765 case Instruction::FDiv:
766 case Instruction::FRem:
767 case Instruction::SDiv:
768 case Instruction::SRem:
769 case Instruction::UDiv:
770 case Instruction::URem:
773 case Instruction::And:
774 case Instruction::Or:
775 if (
any_of(Args, IsWidenableCondition))
812 case Instruction::IntToPtr: {
813 unsigned SrcSize = Src->getScalarSizeInBits();
814 if (
DL.isLegalInteger(SrcSize) &&
815 SrcSize <=
DL.getPointerTypeSizeInBits(Dst))
819 case Instruction::PtrToAddr: {
820 unsigned DstSize = Dst->getScalarSizeInBits();
821 assert(DstSize ==
DL.getAddressSizeInBits(Src));
822 if (
DL.isLegalInteger(DstSize))
826 case Instruction::PtrToInt: {
827 unsigned DstSize = Dst->getScalarSizeInBits();
828 if (
DL.isLegalInteger(DstSize) &&
829 DstSize >=
DL.getPointerTypeSizeInBits(Src))
833 case Instruction::BitCast:
834 if (Dst == Src || (Dst->isPointerTy() && Src->isPointerTy()))
838 case Instruction::Trunc: {
887 ArrayRef<std::tuple<Value *, User *, int>> ScalarUserAndIdx,
902 unsigned Index)
const {
908 const APInt &DemandedDstElts,
919 if (Opcode == Instruction::InsertValue &&
951 bool UseMaskForCond,
bool UseMaskForGaps)
const {
958 switch (ICA.
getID()) {
961 case Intrinsic::allow_runtime_check:
962 case Intrinsic::allow_ubsan_check:
963 case Intrinsic::annotation:
964 case Intrinsic::assume:
965 case Intrinsic::sideeffect:
966 case Intrinsic::pseudoprobe:
967 case Intrinsic::arithmetic_fence:
968 case Intrinsic::invariant_start:
969 case Intrinsic::invariant_end:
970 case Intrinsic::launder_invariant_group:
971 case Intrinsic::is_constant:
972 case Intrinsic::lifetime_start:
973 case Intrinsic::lifetime_end:
974 case Intrinsic::experimental_noalias_scope_decl:
975 case Intrinsic::objectsize:
976 case Intrinsic::ptr_annotation:
977 case Intrinsic::var_annotation:
978 case Intrinsic::experimental_gc_result:
979 case Intrinsic::experimental_gc_relocate:
980 case Intrinsic::coro_alloc:
981 case Intrinsic::coro_begin:
982 case Intrinsic::coro_begin_custom_abi:
983 case Intrinsic::coro_dead:
984 case Intrinsic::coro_id:
985 case Intrinsic::coro_id_async:
986 case Intrinsic::coro_id_retcon:
987 case Intrinsic::coro_id_retcon_once:
988 case Intrinsic::coro_noop:
989 case Intrinsic::coro_free:
990 case Intrinsic::coro_end:
991 case Intrinsic::coro_frame:
992 case Intrinsic::coro_size:
993 case Intrinsic::coro_align:
994 case Intrinsic::coro_suspend:
995 case Intrinsic::coro_subfn_addr:
996 case Intrinsic::threadlocal_address:
997 case Intrinsic::experimental_widenable_condition:
998 case Intrinsic::ssa_copy:
1001 case Intrinsic::bswap:
1012 switch (MICA.
getID()) {
1013 case Intrinsic::masked_scatter:
1014 case Intrinsic::masked_gather:
1015 case Intrinsic::masked_load:
1016 case Intrinsic::masked_store:
1017 case Intrinsic::vp_scatter:
1018 case Intrinsic::vp_gather:
1019 case Intrinsic::masked_compressstore:
1020 case Intrinsic::masked_expandload:
1021 case Intrinsic::speculative_load:
1045 std::optional<FastMathFlags> FMF,
1058 VectorType *Ty, std::optional<FastMathFlags> FMF,
1090 bool CanCreate =
true)
const {
1096 unsigned SrcAddrSpace,
unsigned DestAddrSpace,
1098 std::optional<uint32_t> AtomicElementSize)
const {
1105 unsigned RemainingBytes,
unsigned SrcAddrSpace,
unsigned DestAddrSpace,
1107 std::optional<uint32_t> AtomicCpySize)
const {
1108 unsigned OpSizeInBytes = AtomicCpySize.value_or(1);
1110 for (
unsigned i = 0; i != RemainingBytes; i += OpSizeInBytes)
1116 return (Caller->getFnAttribute(
"target-cpu") ==
1117 Callee->getFnAttribute(
"target-cpu")) &&
1118 (Caller->getFnAttribute(
"target-features") ==
1119 Callee->getFnAttribute(
"target-features"));
1123 unsigned DefaultCallPenalty)
const {
1124 return DefaultCallPenalty;
1137 return (Caller->getFnAttribute(
"target-cpu") ==
1138 Callee->getFnAttribute(
"target-cpu")) &&
1139 (Caller->getFnAttribute(
"target-features") ==
1140 Callee->getFnAttribute(
"target-features"));
1161 unsigned AddrSpace)
const {
1167 unsigned AddrSpace)
const {
1180 GatherUseOps)
const {
1181 return TargetTransformInfo::VectorInstrContext::None;
1189 unsigned ChainSizeInBytes,
1195 unsigned ChainSizeInBytes,
1300 unsigned MaxRequiredSize =
1301 VT->getElementType()->getPrimitiveSizeInBits().getFixedValue();
1303 unsigned MinRequiredSize = 0;
1304 for (
unsigned i = 0, e = VT->getNumElements(); i < e; ++i) {
1305 if (
auto *IntElement =
1307 bool signedElement = IntElement->getValue().isNegative();
1309 unsigned ElementMinRequiredSize =
1310 IntElement->getValue().getSignificantBits() - 1;
1314 MinRequiredSize = std::max(MinRequiredSize, ElementMinRequiredSize);
1317 return MaxRequiredSize;
1320 return MinRequiredSize;
1324 isSigned = CI->getValue().isNegative();
1325 return CI->getValue().getSignificantBits() - 1;
1330 return Cast->getSrcTy()->getScalarSizeInBits() - 1;
1335 return Cast->getSrcTy()->getScalarSizeInBits();
1347 const SCEV *Ptr)
const {
1355 int64_t MergeDistance)
const {
1369template <
typename T>
1381 Type *AccessType)
const override {
1382 assert(PointeeType && Ptr &&
"can't get GEPCost of nullptr");
1384 bool HasBaseReg = (BaseGV ==
nullptr);
1386 auto PtrSizeBits =
DL.getPointerTypeSizeInBits(Ptr->
getType());
1387 APInt BaseOffset(PtrSizeBits, 0);
1391 Type *TargetType =
nullptr;
1399 TargetType = GTI.getIndexedType();
1406 if (
StructType *STy = GTI.getStructTypeOrNull()) {
1408 assert(ConstIdx &&
"Unexpected GEP index");
1410 BaseOffset +=
DL.getStructLayout(STy)->getElementOffset(
Field);
1414 if (TargetType->isScalableTy())
1416 int64_t ElementSize =
1417 GTI.getSequentialElementStride(
DL).getFixedValue();
1426 Scale = ElementSize;
1441 AccessType = TargetType;
1472 for (
const Value *
V : Ptrs) {
1476 if (Info.isSameBase() &&
V !=
Base) {
1477 if (
GEP->hasAllConstantIndices())
1480 Instruction::Add,
GEP->getType(), CostKind,
1481 {TTI::OK_AnyValue, TTI::OP_None}, {TTI::OK_AnyValue, TTI::OP_None},
1486 GEP->getSourceElementType(),
GEP->getPointerOperand(), Indices,
1487 CostKind, AccessTy);
1498 auto *TargetTTI =
static_cast<const T *
>(
this);
1503 if (
const Function *
F = CB->getCalledFunction()) {
1504 if (!TargetTTI->isLoweredToCall(
F))
1513 Type *Ty = U->getType();
1519 case Instruction::Call: {
1523 return TargetTTI->getIntrinsicInstrCost(CostAttrs, CostKind);
1525 case Instruction::UncondBr:
1526 case Instruction::CondBr:
1527 case Instruction::Ret:
1528 case Instruction::PHI:
1529 case Instruction::Switch:
1530 return TargetTTI->getCFInstrCost(Opcode, CostKind,
I);
1531 case Instruction::Freeze:
1533 case Instruction::ExtractValue:
1534 case Instruction::InsertValue:
1535 return TargetTTI->getInsertExtractValueCost(Opcode, CostKind);
1536 case Instruction::Alloca:
1540 case Instruction::GetElementPtr: {
1542 Type *AccessType =
nullptr;
1545 if (
GEP->hasOneUser() &&
I)
1546 AccessType =
I->user_back()->getAccessType();
1548 return TargetTTI->getGEPCost(
GEP->getSourceElementType(),
1550 CostKind, AccessType);
1552 case Instruction::Add:
1553 case Instruction::FAdd:
1554 case Instruction::Sub:
1555 case Instruction::FSub:
1556 case Instruction::Mul:
1557 case Instruction::FMul:
1558 case Instruction::UDiv:
1559 case Instruction::SDiv:
1560 case Instruction::FDiv:
1561 case Instruction::URem:
1562 case Instruction::SRem:
1563 case Instruction::FRem:
1564 case Instruction::Shl:
1565 case Instruction::LShr:
1566 case Instruction::AShr:
1567 case Instruction::And:
1568 case Instruction::Or:
1569 case Instruction::Xor:
1570 case Instruction::FNeg: {
1573 if (Opcode != Instruction::FNeg)
1575 return TargetTTI->getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info,
1578 case Instruction::IntToPtr:
1579 case Instruction::PtrToAddr:
1580 case Instruction::PtrToInt:
1581 case Instruction::SIToFP:
1582 case Instruction::UIToFP:
1583 case Instruction::FPToUI:
1584 case Instruction::FPToSI:
1585 case Instruction::Trunc:
1586 case Instruction::FPTrunc:
1587 case Instruction::BitCast:
1588 case Instruction::FPExt:
1589 case Instruction::SExt:
1590 case Instruction::ZExt:
1591 case Instruction::AddrSpaceCast: {
1593 return TargetTTI->getCastInstrCost(
1596 case Instruction::BitInsert:
1597 return TargetTTI->getBitInsertCost(Ty,
Operands[1]->
getType(), CostKind,
1600 case Instruction::BitExtract:
1601 return TargetTTI->getBitExtractCost(Ty,
Operands[0]->
getType(), CostKind,
1604 case Instruction::Store: {
1608 return TargetTTI->getMemoryOpCost(Opcode, ValTy,
SI->getAlign(),
1609 SI->getPointerAddressSpace(), CostKind,
1612 case Instruction::Load: {
1614 Type *LoadType = U->getType();
1625 LoadType = TI->getDestTy();
1627 return TargetTTI->getMemoryOpCost(Opcode, LoadType, LI->getAlign(),
1629 {TTI::OK_AnyValue, TTI::OP_None},
I);
1631 case Instruction::Select: {
1632 const Value *Op0, *Op1;
1643 return TargetTTI->getArithmeticInstrCost(
1645 CostKind, Op1Info, Op2Info,
Operands,
I);
1650 return TargetTTI->getCmpSelInstrCost(Opcode, U->getType(), CondTy,
1652 CostKind, Op1Info, Op2Info,
I);
1654 case Instruction::ICmp:
1655 case Instruction::FCmp: {
1660 return TargetTTI->getCmpSelInstrCost(Opcode, ValTy, U->getType(),
1663 CostKind, Op1Info, Op2Info,
I);
1665 case Instruction::InsertElement: {
1671 if (CI->getValue().getActiveBits() <= 32)
1672 Idx = CI->getZExtValue();
1673 return TargetTTI->getVectorInstrCost(*IE, Ty, CostKind, Idx,
1676 case Instruction::ShuffleVector: {
1684 int NumSubElts, SubIndex;
1687 if (
all_of(Mask, [](
int M) {
return M < 0; }))
1691 if (Shuffle->changesLength()) {
1693 if (Shuffle->increasesLength() && Shuffle->isIdentityWithPadding())
1696 if (Shuffle->isExtractSubvectorMask(SubIndex))
1698 VecSrcTy, CostKind, Mask, SubIndex,
1701 if (Shuffle->isInsertSubvectorMask(NumSubElts, SubIndex))
1702 return TargetTTI->getShuffleCost(
1708 int ReplicationFactor, VF;
1709 if (Shuffle->isReplicationMask(ReplicationFactor, VF)) {
1713 DemandedDstElts.
setBit(
I.index());
1715 return TargetTTI->getReplicationShuffleCost(
1716 VecSrcTy->getElementType(), ReplicationFactor, VF,
1717 DemandedDstElts, CostKind);
1721 NumSubElts = VecSrcTy->getElementCount().getKnownMinValue();
1727 if (Shuffle->increasesLength()) {
1728 for (
int &M : AdjustMask)
1729 M = M >= NumSubElts ? (M + (Mask.size() - NumSubElts)) : M;
1731 return TargetTTI->getShuffleCost(
1733 VecTy, CostKind, AdjustMask, 0,
nullptr,
Operands, Shuffle);
1744 VecSrcTy, VecSrcTy, CostKind, AdjustMask, 0,
nullptr,
Operands,
1748 std::iota(ExtractMask.
begin(), ExtractMask.
end(), 0);
1749 return ShuffleCost + TargetTTI->getShuffleCost(
1751 CostKind, ExtractMask, 0, VecTy, {}, Shuffle);
1754 if (Shuffle->isIdentity())
1757 if (Shuffle->isReverse())
1759 CostKind, Mask, 0,
nullptr,
Operands,
1762 if (Shuffle->isTranspose())
1764 CostKind, Mask, 0,
nullptr,
Operands,
1767 if (Shuffle->isZeroEltSplat())
1769 CostKind, Mask, 0,
nullptr,
Operands,
1772 if (Shuffle->isSingleSource())
1774 VecSrcTy, CostKind, Mask, 0,
nullptr,
1777 if (Shuffle->isInsertSubvectorMask(NumSubElts, SubIndex))
1778 return TargetTTI->getShuffleCost(
1783 if (Shuffle->isSelect())
1784 return TargetTTI->getShuffleCost(
TTI::SK_Select, VecTy, VecSrcTy,
1785 CostKind, Mask, 0,
nullptr,
Operands,
1788 if (Shuffle->isSplice(SubIndex))
1789 return TargetTTI->getShuffleCost(
TTI::SK_Splice, VecTy, VecSrcTy,
1790 CostKind, Mask, SubIndex,
nullptr,
1794 CostKind, Mask, 0,
nullptr,
Operands,
1797 case Instruction::ExtractElement: {
1803 if (CI->getValue().getActiveBits() <= 32)
1804 Idx = CI->getZExtValue();
1806 return TargetTTI->getVectorInstrCost(*EEI, DstTy, CostKind, Idx);
1815 auto *TargetTTI =
static_cast<const T *
>(
this);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
static bool isSigned(unsigned Opcode)
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
uint64_t IntrinsicInst * II
OptimizedStructLayoutField Field
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
static SymbolRef::Type getType(const Symbol *Sym)
static void computeKnownBits(const Value *V, const APInt &DemandedElts, KnownBits &Known, const SimplifyQuery &Q, unsigned Depth)
Determine which bits of V are known to be either zero or one and return them in the Known bit set.
Class for arbitrary precision integers.
void setBit(unsigned BitPosition)
Set the given bit to 1 whose position is given as "bitPosition".
unsigned getBitWidth() const
Return the number of bits in the APInt.
LLVM_ABI APInt sextOrTrunc(unsigned width) const
Sign extend or truncate to width.
static APInt getZero(unsigned numBits)
Get the '0' value for the specified bit-width.
int64_t getSExtValue() const
Get sign extended value.
This class represents a conversion between pointers from one address space to another.
an instruction to allocate memory on the stack
Represent a constant reference to an array (0 or more elements consecutively in memory),...
A cache of @llvm.assume calls within a function.
Functions, function parameters, and return types can have attributes to indicate how they should be t...
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Conditional Branch instruction.
This is the shared class of boolean and integer constants.
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
const APInt & getValue() const
Return the constant as an APInt value reference.
This is an important base class in LLVM.
A parsed version of the target data layout string in and methods for querying it.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
static constexpr ElementCount get(ScalarTy MinVal, bool Scalable)
Convenience struct for specifying and reasoning about fast-math flags.
static LLVM_ABI FixedVectorType * get(Type *ElementType, unsigned NumElts)
This instruction compares its operands according to the predicate given to the constructor.
The core instruction combiner logic.
static InstructionCost getInvalid(CostType Val=0)
Type * getReturnType() const
Intrinsic::ID getID() const
A wrapper class for inspecting calls to intrinsic functions.
This is an important class for using LLVM in a threaded context.
An instruction for reading from memory.
Represents a single loop in the control flow graph.
Information for memory intrinsic cost model.
Intrinsic::ID getID() const
unsigned getOpcode() const
Return the opcode for this Instruction or ConstantExpr.
Analysis providing profile information.
The RecurrenceDescriptor is used to identify recurrences variables in a loop.
This node represents a polynomial recurrence on the trip count of the specified loop.
SCEVUse getStepRecurrence(ScalarEvolution &SE) const
Constructs and returns the recurrence indicating how much this expression steps by.
This class represents a constant integer value.
const APInt & getAPInt() const
This class represents an analyzed expression in the program.
The main scalar evolution driver.
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is ...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
void push_back(const T &Elt)
LLVM_NO_SANITIZE_CFI_UNRELATED_CAST iterator begin()
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StackOffset holds a fixed and a scalable offset in bytes.
static StackOffset getScalable(int64_t Scalable)
static StackOffset getFixed(int64_t Fixed)
An instruction for storing to memory.
Represent a constant reference to a string, i.e.
Class to represent struct types.
Provides information about what library functions are available for the current target.
This class represents a truncation of integer types.
static constexpr TypeSize get(ScalarTy Quantity, bool Scalable)
The instances of the Type class are immutable: once they are created, they are never changed.
bool isVectorTy() const
True if this is an instance of VectorType.
LLVM_ABI unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
static LLVM_ABI IntegerType * getInt8Ty(LLVMContext &C)
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
bool isPtrOrPtrVectorTy() const
Return true if this is a pointer type or a vector of pointer types.
static LLVM_ABI IntegerType * getIntNTy(LLVMContext &C, unsigned N)
This is the common base class for vector predication intrinsics.
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
LLVM_ABI const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
Base class of all SIMD vector types.
constexpr ScalarTy getFixedValue() const
constexpr bool isScalable() const
Returns whether the quantity is scaled by a runtime quantity (vscale).
An efficient, type-erasing, non-owning reference to a callable.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This namespace contains an enum with a value for every intrinsic/builtin function known by LLVM.
match_combine_or< Ty... > m_CombineOr(const Ty &...Ps)
Combine pattern matchers matching any of Ps patterns.
LogicalOp_match< LHS, RHS, Instruction::And > m_LogicalAnd(const LHS &L, const RHS &R)
Matches L && R either in the form of L & R or L ?
bool match(Val *V, const Pattern &P)
ThreeOps_match< Cond, LHS, RHS, Instruction::Select > m_Select(const Cond &C, const LHS &L, const RHS &R)
Matches SelectInst.
auto m_Value()
Match an arbitrary value and ignore it.
auto m_Constant()
Match an arbitrary Constant and ignore it.
auto m_LogicalOr()
Matches L || R where L and R are arbitrary values.
auto m_LogicalAnd()
Matches L && R where L and R are arbitrary values.
LogicalOp_match< LHS, RHS, Instruction::Or > m_LogicalOr(const LHS &L, const RHS &R)
Matches L || R either in the form of L | R or L ?
This is an optimization pass for GlobalISel generic memory operations.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
@ Known
Known to have no common set bits.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
constexpr bool isPowerOf2_64(uint64_t Value)
Return true if the argument is a power of two > 0 (64 bit edition.)
LLVM_ABI Value * getSplatValue(const Value *V)
Get splat value if the input is a splat vector or return nullptr.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
constexpr int PoisonMaskElem
RecurKind
These are the kinds of recurrences that we support.
@ Fast
Assign the register banks as fast as possible (default).
constexpr unsigned BitWidth
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
gep_type_iterator gep_type_begin(const User *GEP)
@ DataWithoutLaneMask
Same as Data, but avoids using the get.active.lane.mask intrinsic to calculate the mask and instead i...
ValueUniformity
Enum describing how values behave with respect to uniformity and divergence, to answer the question: ...
@ Default
The result value is uniform if and only if all operands are uniform.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Attributes of a target dependent hardware loop.
KnownBits anyextOrTrunc(unsigned BitWidth) const
Return known bits for an "any" extension or truncation of the value we're tracking.
Information about a load/store intrinsic defined by the target.