14#ifndef LLVM_ANALYSIS_TARGETTRANSFORMINFOIMPL_H
15#define LLVM_ANALYSIS_TARGETTRANSFORMINFOIMPL_H
61 if (!isa<Constant>(Operand))
81 return SI.getNumCases();
163 virtual std::pair<const Value *, unsigned>
165 return std::make_pair(
nullptr, -1);
175 assert(
F &&
"A concrete function must be provided to this routine.");
182 if (
F->isIntrinsic())
185 if (
F->hasLocalLinkage() || !
F->hasName())
192 if (
Name ==
"copysign" ||
Name ==
"copysignf" ||
Name ==
"copysignl" ||
202 Name ==
"atan2" ||
Name ==
"atan2f" ||
Name ==
"atan2l"||
207 Name ==
"exp10" ||
Name ==
"exp10l" ||
Name ==
"exp10f")
212 Name ==
"exp2l" ||
Name ==
"exp2f" ||
Name ==
"floor" ||
213 Name ==
"floorf" ||
Name ==
"ceil" ||
Name ==
"round" ||
239 virtual std::optional<Instruction *>
244 virtual std::optional<Value *>
247 bool &KnownBitsComputed)
const {
255 SimplifyAndSetOp)
const {
273 int64_t BaseOffset,
bool HasBaseReg,
274 int64_t Scale,
unsigned AddrSpace,
276 int64_t ScalableOffset = 0)
const {
279 return !BaseGV && BaseOffset == 0 && (Scale == 0 || Scale == 1);
349 Align Alignment)
const {
354 Align Alignment)
const {
359 Align Alignment)
const {
379 unsigned AddrSpace)
const {
384 Type *DataType)
const {
402 bool HasBaseReg, int64_t Scale,
403 unsigned AddrSpace)
const {
406 Scale, AddrSpace,
nullptr,
418 virtual bool useAA()
const {
return false; }
439 unsigned ScalarOpdIdx)
const {
494 return isa<SelectInst>(
I) &&
511 unsigned *
Fast)
const {
567 Type *Ty =
nullptr)
const {
574 return "Generic::Unknown Register Class";
576 return "Generic::ScalarRC";
578 return "Generic::VectorRC";
589 virtual std::optional<unsigned>
getMaxVScale()
const {
return std::nullopt; }
604 virtual unsigned getMaximumVF(
unsigned ElemWidth,
unsigned Opcode)
const {
612 const Instruction &
I,
bool &AllowPromotionWithoutCommonHeader)
const {
613 AllowPromotionWithoutCommonHeader =
false;
618 virtual std::optional<unsigned>
629 virtual std::optional<unsigned>
645 unsigned NumStridedMemAccesses,
646 unsigned NumPrefetches,
647 bool HasCall)
const {
655 unsigned Opcode,
Type *InputTypeA,
Type *InputTypeB,
Type *AccumType,
670 auto IsWidenableCondition = [](
const Value *V) {
671 if (
auto *
II = dyn_cast<IntrinsicInst>(V))
672 if (
II->getIntrinsicID() == Intrinsic::experimental_widenable_condition)
681 case Instruction::FDiv:
682 case Instruction::FRem:
683 case Instruction::SDiv:
684 case Instruction::SRem:
685 case Instruction::UDiv:
686 case Instruction::URem:
689 case Instruction::And:
690 case Instruction::Or:
691 if (
any_of(Args, IsWidenableCondition))
726 case Instruction::IntToPtr: {
727 unsigned SrcSize = Src->getScalarSizeInBits();
733 case Instruction::PtrToAddr: {
734 unsigned DstSize = Dst->getScalarSizeInBits();
740 case Instruction::PtrToInt: {
741 unsigned DstSize = Dst->getScalarSizeInBits();
747 case Instruction::BitCast:
748 if (Dst == Src || (Dst->isPointerTy() && Src->isPointerTy()))
752 case Instruction::Trunc: {
790 const Value *Op1)
const {
801 ArrayRef<std::tuple<Value *, User *, int>> ScalarUserAndIdx)
const {
807 unsigned Index)
const {
814 unsigned Index)
const {
820 const APInt &DemandedDstElts,
831 if (Opcode == Instruction::InsertValue &&
861 bool VariableMask,
Align Alignment,
868 unsigned Opcode,
Type *DataTy,
bool VariableMask,
Align Alignment,
875 bool VariableMask,
Align Alignment,
884 bool UseMaskForCond,
bool UseMaskForGaps)
const {
891 switch (ICA.
getID()) {
894 case Intrinsic::allow_runtime_check:
895 case Intrinsic::allow_ubsan_check:
896 case Intrinsic::annotation:
897 case Intrinsic::assume:
898 case Intrinsic::sideeffect:
899 case Intrinsic::pseudoprobe:
900 case Intrinsic::arithmetic_fence:
901 case Intrinsic::dbg_assign:
902 case Intrinsic::dbg_declare:
903 case Intrinsic::dbg_value:
904 case Intrinsic::dbg_label:
905 case Intrinsic::invariant_start:
906 case Intrinsic::invariant_end:
907 case Intrinsic::launder_invariant_group:
908 case Intrinsic::strip_invariant_group:
909 case Intrinsic::is_constant:
910 case Intrinsic::lifetime_start:
911 case Intrinsic::lifetime_end:
912 case Intrinsic::experimental_noalias_scope_decl:
913 case Intrinsic::objectsize:
914 case Intrinsic::ptr_annotation:
915 case Intrinsic::var_annotation:
916 case Intrinsic::experimental_gc_result:
917 case Intrinsic::experimental_gc_relocate:
918 case Intrinsic::coro_alloc:
919 case Intrinsic::coro_begin:
920 case Intrinsic::coro_begin_custom_abi:
921 case Intrinsic::coro_free:
922 case Intrinsic::coro_end:
923 case Intrinsic::coro_frame:
924 case Intrinsic::coro_size:
925 case Intrinsic::coro_align:
926 case Intrinsic::coro_suspend:
927 case Intrinsic::coro_subfn_addr:
928 case Intrinsic::threadlocal_address:
929 case Intrinsic::experimental_widenable_condition:
930 case Intrinsic::ssa_copy:
955 std::optional<FastMathFlags> FMF,
968 VectorType *Ty, std::optional<FastMathFlags> FMF,
1000 bool CanCreate =
true)
const {
1006 unsigned SrcAddrSpace,
unsigned DestAddrSpace,
1008 std::optional<uint32_t> AtomicElementSize)
const {
1015 unsigned RemainingBytes,
unsigned SrcAddrSpace,
unsigned DestAddrSpace,
1017 std::optional<uint32_t> AtomicCpySize)
const {
1018 unsigned OpSizeInBytes = AtomicCpySize.value_or(1);
1020 for (
unsigned i = 0; i != RemainingBytes; i += OpSizeInBytes)
1026 return (Caller->getFnAttribute(
"target-cpu") ==
1027 Callee->getFnAttribute(
"target-cpu")) &&
1028 (Caller->getFnAttribute(
"target-features") ==
1029 Callee->getFnAttribute(
"target-features"));
1033 unsigned DefaultCallPenalty)
const {
1034 return DefaultCallPenalty;
1040 return (Caller->getFnAttribute(
"target-cpu") ==
1041 Callee->getFnAttribute(
"target-cpu")) &&
1042 (Caller->getFnAttribute(
"target-features") ==
1043 Callee->getFnAttribute(
"target-features"));
1064 unsigned AddrSpace)
const {
1070 unsigned AddrSpace)
const {
1084 unsigned ChainSizeInBytes,
1090 unsigned ChainSizeInBytes,
1166 if (isa<ConstantDataVector>(Val) || isa<ConstantVector>(Val)) {
1167 const auto *VectorValue = cast<Constant>(Val);
1171 auto *VT = cast<FixedVectorType>(Val->
getType());
1177 unsigned MaxRequiredSize =
1178 VT->getElementType()->getPrimitiveSizeInBits().getFixedValue();
1180 unsigned MinRequiredSize = 0;
1181 for (
unsigned i = 0, e = VT->getNumElements(); i < e; ++i) {
1182 if (
auto *IntElement =
1183 dyn_cast<ConstantInt>(VectorValue->getAggregateElement(i))) {
1184 bool signedElement = IntElement->getValue().isNegative();
1186 unsigned ElementMinRequiredSize =
1187 IntElement->getValue().getSignificantBits() - 1;
1191 MinRequiredSize = std::max(MinRequiredSize, ElementMinRequiredSize);
1194 return MaxRequiredSize;
1197 return MinRequiredSize;
1200 if (
const auto *CI = dyn_cast<ConstantInt>(Val)) {
1201 isSigned = CI->getValue().isNegative();
1202 return CI->getValue().getSignificantBits() - 1;
1205 if (
const auto *Cast = dyn_cast<SExtInst>(Val)) {
1207 return Cast->getSrcTy()->getScalarSizeInBits() - 1;
1210 if (
const auto *Cast = dyn_cast<ZExtInst>(Val)) {
1212 return Cast->getSrcTy()->getScalarSizeInBits();
1220 return Ptr && isa<SCEVAddRecExpr>(
Ptr);
1232 int64_t MergeDistance)
const {
1246template <
typename T>
1258 assert(PointeeType &&
Ptr &&
"can't get GEPCost of nullptr");
1259 auto *BaseGV = dyn_cast<GlobalValue>(
Ptr->stripPointerCasts());
1260 bool HasBaseReg = (BaseGV ==
nullptr);
1263 APInt BaseOffset(PtrSizeBits, 0);
1267 Type *TargetType =
nullptr;
1275 TargetType = GTI.getIndexedType();
1278 const ConstantInt *ConstIdx = dyn_cast<ConstantInt>(*
I);
1281 ConstIdx = dyn_cast<ConstantInt>(
Splat);
1282 if (
StructType *STy = GTI.getStructTypeOrNull()) {
1284 assert(ConstIdx &&
"Unexpected GEP index");
1292 int64_t ElementSize =
1293 GTI.getSequentialElementStride(
DL).getFixedValue();
1302 Scale = ElementSize;
1317 AccessType = TargetType;
1324 Ptr->getType()->getPointerAddressSpace()))
1348 for (
const Value *V : Ptrs) {
1349 const auto *
GEP = dyn_cast<GetElementPtrInst>(V);
1352 if (
Info.isSameBase() && V !=
Base) {
1353 if (
GEP->hasAllConstantIndices())
1362 GEP->getSourceElementType(),
GEP->getPointerOperand(), Indices,
1374 auto *TargetTTI =
static_cast<const T *
>(
this);
1377 auto *CB = dyn_cast<CallBase>(U);
1378 if (CB && !isa<IntrinsicInst>(U)) {
1379 if (
const Function *
F = CB->getCalledFunction()) {
1380 if (!TargetTTI->isLoweredToCall(
F))
1389 Type *Ty = U->getType();
1391 auto *
I = dyn_cast<Instruction>(U);
1395 case Instruction::Call: {
1396 assert(isa<IntrinsicInst>(U) &&
"Unexpected non-intrinsic call");
1397 auto *Intrinsic = cast<IntrinsicInst>(U);
1399 return TargetTTI->getIntrinsicInstrCost(CostAttrs,
CostKind);
1401 case Instruction::Br:
1402 case Instruction::Ret:
1403 case Instruction::PHI:
1404 case Instruction::Switch:
1405 return TargetTTI->getCFInstrCost(Opcode,
CostKind,
I);
1406 case Instruction::Freeze:
1408 case Instruction::ExtractValue:
1409 case Instruction::InsertValue:
1410 return TargetTTI->getInsertExtractValueCost(Opcode,
CostKind);
1411 case Instruction::Alloca:
1412 if (cast<AllocaInst>(U)->isStaticAlloca())
1415 case Instruction::GetElementPtr: {
1416 const auto *
GEP = cast<GEPOperator>(U);
1417 Type *AccessType =
nullptr;
1420 if (
GEP->hasOneUser() &&
I)
1421 AccessType =
I->user_back()->getAccessType();
1423 return TargetTTI->getGEPCost(
GEP->getSourceElementType(),
1427 case Instruction::Add:
1428 case Instruction::FAdd:
1429 case Instruction::Sub:
1430 case Instruction::FSub:
1431 case Instruction::Mul:
1432 case Instruction::FMul:
1433 case Instruction::UDiv:
1434 case Instruction::SDiv:
1435 case Instruction::FDiv:
1436 case Instruction::URem:
1437 case Instruction::SRem:
1438 case Instruction::FRem:
1439 case Instruction::Shl:
1440 case Instruction::LShr:
1441 case Instruction::AShr:
1442 case Instruction::And:
1443 case Instruction::Or:
1444 case Instruction::Xor:
1445 case Instruction::FNeg: {
1448 if (Opcode != Instruction::FNeg)
1450 return TargetTTI->getArithmeticInstrCost(Opcode, Ty,
CostKind, Op1Info,
1453 case Instruction::IntToPtr:
1454 case Instruction::PtrToAddr:
1455 case Instruction::PtrToInt:
1456 case Instruction::SIToFP:
1457 case Instruction::UIToFP:
1458 case Instruction::FPToUI:
1459 case Instruction::FPToSI:
1460 case Instruction::Trunc:
1461 case Instruction::FPTrunc:
1462 case Instruction::BitCast:
1463 case Instruction::FPExt:
1464 case Instruction::SExt:
1465 case Instruction::ZExt:
1466 case Instruction::AddrSpaceCast: {
1468 return TargetTTI->getCastInstrCost(
1471 case Instruction::Store: {
1472 auto *SI = cast<StoreInst>(U);
1475 return TargetTTI->getMemoryOpCost(Opcode, ValTy, SI->getAlign(),
1476 SI->getPointerAddressSpace(),
CostKind,
1479 case Instruction::Load: {
1483 auto *LI = cast<LoadInst>(U);
1484 Type *LoadType = U->getType();
1494 if (
const TruncInst *TI = dyn_cast<TruncInst>(*LI->user_begin()))
1495 LoadType = TI->getDestTy();
1497 return TargetTTI->getMemoryOpCost(Opcode, LoadType, LI->getAlign(),
1499 {TTI::OK_AnyValue, TTI::OP_None},
I);
1501 case Instruction::Select: {
1502 const Value *Op0, *Op1;
1513 return TargetTTI->getArithmeticInstrCost(
1520 return TargetTTI->getCmpSelInstrCost(Opcode, U->getType(), CondTy,
1524 case Instruction::ICmp:
1525 case Instruction::FCmp: {
1530 return TargetTTI->getCmpSelInstrCost(Opcode, ValTy, U->getType(),
1531 I ? cast<CmpInst>(
I)->getPredicate()
1535 case Instruction::InsertElement: {
1536 auto *IE = dyn_cast<InsertElementInst>(U);
1540 if (
auto *CI = dyn_cast<ConstantInt>(
Operands[2]))
1541 if (CI->getValue().getActiveBits() <= 32)
1542 Idx = CI->getZExtValue();
1543 return TargetTTI->getVectorInstrCost(*IE, Ty,
CostKind,
Idx);
1545 case Instruction::ShuffleVector: {
1546 auto *Shuffle = dyn_cast<ShuffleVectorInst>(U);
1550 auto *VecTy = cast<VectorType>(U->getType());
1553 int NumSubElts, SubIndex;
1556 if (
all_of(Mask, [](
int M) {
return M < 0; }))
1560 if (Shuffle->changesLength()) {
1562 if (Shuffle->increasesLength() && Shuffle->isIdentityWithPadding())
1565 if (Shuffle->isExtractSubvectorMask(SubIndex))
1567 VecSrcTy, Mask,
CostKind, SubIndex,
1570 if (Shuffle->isInsertSubvectorMask(NumSubElts, SubIndex))
1571 return TargetTTI->getShuffleCost(
1577 int ReplicationFactor, VF;
1578 if (Shuffle->isReplicationMask(ReplicationFactor, VF)) {
1582 DemandedDstElts.
setBit(
I.index());
1584 return TargetTTI->getReplicationShuffleCost(
1585 VecSrcTy->getElementType(), ReplicationFactor, VF,
1589 bool IsUnary = isa<UndefValue>(
Operands[1]);
1590 NumSubElts = VecSrcTy->getElementCount().getKnownMinValue();
1596 if (Shuffle->increasesLength()) {
1597 for (
int &M : AdjustMask)
1598 M = M >= NumSubElts ? (M + (Mask.size() - NumSubElts)) : M;
1600 return TargetTTI->getShuffleCost(
1617 std::iota(ExtractMask.
begin(), ExtractMask.
end(), 0);
1618 return ShuffleCost + TargetTTI->getShuffleCost(
1620 ExtractMask,
CostKind, 0, VecTy, {}, Shuffle);
1623 if (Shuffle->isIdentity())
1626 if (Shuffle->isReverse())
1627 return TargetTTI->getShuffleCost(
TTI::SK_Reverse, VecTy, VecSrcTy, Mask,
1631 if (Shuffle->isTranspose())
1636 if (Shuffle->isZeroEltSplat())
1641 if (Shuffle->isSingleSource())
1643 VecSrcTy, Mask,
CostKind, 0,
nullptr,
1646 if (Shuffle->isInsertSubvectorMask(NumSubElts, SubIndex))
1647 return TargetTTI->getShuffleCost(
1652 if (Shuffle->isSelect())
1653 return TargetTTI->getShuffleCost(
TTI::SK_Select, VecTy, VecSrcTy, Mask,
1657 if (Shuffle->isSplice(SubIndex))
1658 return TargetTTI->getShuffleCost(
TTI::SK_Splice, VecTy, VecSrcTy, Mask,
1666 case Instruction::ExtractElement: {
1667 auto *EEI = dyn_cast<ExtractElementInst>(U);
1671 if (
auto *CI = dyn_cast<ConstantInt>(
Operands[1]))
1672 if (CI->getValue().getActiveBits() <= 32)
1673 Idx = CI->getZExtValue();
1675 return TargetTTI->getVectorInstrCost(*EEI, DstTy,
CostKind,
Idx);
1684 auto *TargetTTI =
static_cast<const T *
>(
this);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Analysis containing CSE Info
static cl::opt< OutputCostKind > CostKind("cost-kind", cl::desc("Target cost kind"), cl::init(OutputCostKind::RecipThroughput), cl::values(clEnumValN(OutputCostKind::RecipThroughput, "throughput", "Reciprocal throughput"), clEnumValN(OutputCostKind::Latency, "latency", "Instruction latency"), clEnumValN(OutputCostKind::CodeSize, "code-size", "Code size"), clEnumValN(OutputCostKind::SizeAndLatency, "size-latency", "Code size and latency"), clEnumValN(OutputCostKind::All, "all", "Print all cost kinds")))
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
static bool isSigned(unsigned int Opcode)
mir Rename Register Operands
uint64_t IntrinsicInst * II
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)
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.
an instruction to allocate memory on the stack
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Class to represent array types.
A cache of @llvm.assume calls within a function.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
Conditional or Unconditional Branch instruction.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
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.
unsigned getAddressSizeInBits(unsigned AS) const
The size in bits of an address in for the given AS.
bool isLegalInteger(uint64_t Width) const
Returns true if the specified type is known to be a native integer type supported by the CPU.
LLVM_ABI const StructLayout * getStructLayout(StructType *Ty) const
Returns a StructLayout object, indicating the alignment of the struct, its size, and the offsets of i...
LLVM_ABI unsigned getPointerTypeSizeInBits(Type *) const
The pointer representation size in bits for this type.
TypeSize getTypeSizeInBits(Type *Ty) const
Size examples:
TypeSize getTypeStoreSize(Type *Ty) const
Returns the maximum number of bytes that may be overwritten by storing the specified type.
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)
The core instruction combiner logic.
static InstructionCost getInvalid(CostType Val=0)
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.
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.
const SCEV * 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)
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.
StringRef - Represent a constant reference to a string, i.e.
TypeSize getElementOffset(unsigned Idx) const
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 getFixed(ScalarTy ExactSize)
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.
static LLVM_ABI IntegerType * getInt8Ty(LLVMContext &C)
static LLVM_ABI IntegerType * getIntNTy(LLVMContext &C, unsigned N)
LLVM_ABI unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
LLVM_ABI bool isScalableTy(SmallPtrSetImpl< const Type * > &Visited) const
Return true if this is a type whose size is a known multiple of vscale.
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
LLVM_ABI unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
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.
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).
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ Fast
Attempts to make calls as fast as possible (e.g.
@ C
The default llvm calling convention, compatible with C.
class_match< Constant > m_Constant()
Match an arbitrary Constant and ignore it.
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_LogicalOr()
Matches L || R where L and R are arbitrary values.
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
auto m_LogicalAnd()
Matches L && R where L and R are arbitrary values.
match_combine_or< LTy, RTy > m_CombineOr(const LTy &L, const RTy &R)
Combine two pattern matchers matching L || R.
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.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...
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.
constexpr int PoisonMaskElem
RecurKind
These are the kinds of recurrences that we support.
constexpr unsigned BitWidth
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...
This struct is a compact representation of a valid (non-zero power of two) alignment.
Attributes of a target dependent hardware loop.
Information about a load/store intrinsic defined by the target.