21#ifndef LLVM_ANALYSIS_TARGETTRANSFORMINFO_H
22#define LLVM_ANALYSIS_TARGETTRANSFORMINFO_H
125 bool ForceNestedLoop =
false,
126 bool ForceHardwareLoopPHI =
false);
137 const Value *Ptr =
nullptr;
140 Type *DataTy =
nullptr;
147 bool VariableMask =
true;
150 unsigned AddressSpace = 0;
155 const Value *StrideVal;
159 bool VariableMask,
Align Alignment,
161 const Value *StrideVal =
nullptr)
163 : I(I), Ptr(Ptr), DataTy(DataTy), IID(Id), VariableMask(VariableMask),
164 Alignment(Alignment), StrideVal(StrideVal) {}
167 unsigned AddressSpace = 0,
168 const Value *StrideVal =
nullptr)
169 : DataTy(DataTy), IID(Id), AddressSpace(AddressSpace),
170 Alignment(Alignment), StrideVal(StrideVal) {}
174 const Value *StrideVal =
nullptr)
176 : I(I), DataTy(DataTy), IID(Id), VariableMask(VariableMask),
177 Alignment(Alignment), StrideVal(StrideVal) {}
210 Type *RetTy =
nullptr;
224 bool TypeBasedOnly =
false);
251 return Arguments.empty();
295class TargetTransformInfo;
326 std::unique_ptr<const TargetTransformInfoImplBase> Impl);
349 FunctionAnalysisManager::Invalidator &) {
408 TargetCostKind CostKind,
409 Type *AccessType =
nullptr)
const;
439 static_assert(
sizeof(PointersChainInfo) == 4,
"Was size increase justified?");
447 const PointersChainInfo &Info,
Type *AccessTy,
448 const TargetCostKind CostKind)
const;
521 TargetCostKind CostKind)
const;
606 LLVM_ABI std::pair<KnownBits, KnownBits>
613 unsigned FromAS,
unsigned ToAS,
const KnownBits &FromPtrBits)
const;
634 unsigned DstAS)
const;
643 LLVM_ABI std::pair<const Value *, unsigned>
722 unsigned MaxCount = std::numeric_limits<unsigned>::max();
837 LLVM_ABI std::optional<Instruction *>
844 bool &KnownBitsComputed)
const;
851 SimplifyAndSetOp)
const;
878 const APInt &PostIncExitValue)
const;
891 int64_t BaseOffset,
bool HasBaseReg,
892 int64_t Scale,
unsigned AddrSpace = 0,
894 int64_t ScalableOffset = 0)
const;
974 Align Alignment)
const;
978 Align Alignment)
const;
982 Align Alignment)
const;
994 unsigned AddrSpace)
const;
998 Type *DataType)
const;
1034 bool IsStore =
false,
1035 std::optional<Instruction::CastOps> CastHint = std::nullopt)
const;
1065 bool HasBaseReg, int64_t Scale,
1066 unsigned AddrSpace = 0)
const;
1117 unsigned ScalarOpdIdx)
const;
1177 GatherUseOps)
const;
1250 bool IsZeroCmp)
const;
1283 unsigned *
Fast =
nullptr)
const;
1414 return {MergeKind, MergeProp};
1437 Type *Ty =
nullptr)
const;
1474 Type *ElementTy =
nullptr)
const;
1499 unsigned AddrSpace)
const;
1505 const Instruction &
I,
bool &AllowPromotionWithoutCommonHeader)
const;
1553 unsigned NumStridedMemAccesses,
1554 unsigned NumPrefetches,
1555 bool HasCall)
const;
1593 unsigned Opcode,
Type *InputTypeA,
Type *InputTypeB,
Type *AccumType,
1604 bool HasUnorderedReductions)
const;
1643 const TargetLibraryInfo *TLibInfo =
nullptr,
1657 VectorType *VecTy,
unsigned Opcode0,
unsigned Opcode1,
1669 ShuffleKind Kind, VectorType *DstTy, VectorType *SrcTy,
1751 unsigned Index = -1,
const Value *Op0 =
nullptr,
1752 const Value *Op1 =
nullptr,
1767 ArrayRef<std::tuple<Value *, User *, unsigned>> ScalarUserAndIdx,
1778 unsigned Index = -1,
1787 unsigned Index)
const;
1806 const Instruction *CtxI)
const;
1819 const Instruction *CtxI)
const;
1827 Type *EltTy,
int ReplicationFactor,
int VF,
const APInt &DemandedDstElts,
1850 unsigned Opcode,
Type *VecTy,
unsigned Factor, ArrayRef<unsigned> Indices,
1852 bool UseMaskForCond =
false,
bool UseMaskForGaps =
false)
const;
1857 return FMF && !(*FMF).allowReassoc();
1885 unsigned Opcode,
VectorType *Ty, std::optional<FastMathFlags> FMF,
1966 bool CanCreate =
true)
const;
1971 unsigned DestAddrSpace,
Align SrcAlign,
Align DestAlign,
1972 std::optional<uint32_t> AtomicElementSize = std::nullopt)
const;
1982 unsigned RemainingBytes,
unsigned SrcAddrSpace,
unsigned DestAddrSpace,
1984 std::optional<uint32_t> AtomicCpySize = std::nullopt)
const;
1999 unsigned DefaultCallPenalty)
const;
2043 unsigned AddrSpace)
const;
2048 unsigned AddrSpace)
const;
2060 unsigned ChainSizeInBytes,
2066 unsigned ChainSizeInBytes,
2150 const LoopInfo *LI =
nullptr)
const;
2242 std::unique_ptr<const TargetTransformInfoImplBase> TTIImpl;
2254 std::optional<unsigned>
2256 unsigned Cost = ~0U;
2272 return std::nullopt;
2307 : TTICallback(Arg.TTICallback) {}
2309 : TTICallback(
std::
move(Arg.TTICallback)) {}
2311 TTICallback =
RHS.TTICallback;
2315 TTICallback = std::move(
RHS.TTICallback);
2347 std::optional<TargetTransformInfo> TTI;
2349 virtual void anchor();
This file implements a class to represent arbitrary precision integral constant values and operations...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Atomic ordering constants.
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
TargetTransformInfo::VPLegalization VPLegalization
This header defines various interfaces for pass management in LLVM.
This file defines an InstructionCost class that is used when calculating the cost of an instruction,...
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
SmallVector< MachineOperand, 4 > Cond
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 TableGen::Emitter::Opt Y("gen-skeleton-entry", EmitSkeleton, "Generate example skeleton entry")
Class for arbitrary precision integers.
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...
LLVM Basic Block Representation.
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 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.
Convenience struct for specifying and reasoning about fast-math flags.
This instruction compares its operands according to the predicate given to the constructor.
ImmutablePass class - This class is used to provide information that does not need to be run.
The core instruction combiner logic.
static InstructionCost getInvalid(CostType Val=0)
Class to represent integer types.
Drive the analysis of interleaved memory accesses in the loop.
FastMathFlags getFlags() const
const SmallVectorImpl< Type * > & getArgTypes() const
Type * getReturnType() const
bool skipScalarizationCost() const
const SmallVectorImpl< const Value * > & getArgs() const
LLVM_ABI IntrinsicCostAttributes(Intrinsic::ID Id, const CallBase &CI, InstructionCost ScalarCost=InstructionCost::getInvalid(), bool TypeBasedOnly=false)
VectorInstrContext getVectorInstrContext() const
InstructionCost getScalarizationCost() const
const IntrinsicInst * getInst() const
Intrinsic::ID getID() const
bool isTypeBasedOnly() 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.
LoopVectorizationLegality checks if it is legal to vectorize a loop, and to what vectorization factor...
Represents a single loop in the control flow graph.
Information for memory intrinsic cost model.
Align getAlignment() const
unsigned getAddressSpace() const
Type * getDataType() const
MemIntrinsicCostAttributes(Intrinsic::ID Id, Type *DataTy, const Value *Ptr, bool VariableMask, Align Alignment, const Instruction *I=nullptr, const Value *StrideVal=nullptr)
MemIntrinsicCostAttributes(Intrinsic::ID Id, Type *DataTy, bool VariableMask, Align Alignment, const Instruction *I=nullptr, const Value *StrideVal=nullptr)
const Value * getPointer() const
bool getVariableMask() const
const Value * getStrideVal() const
Intrinsic::ID getID() const
MemIntrinsicCostAttributes(Intrinsic::ID Id, Type *DataTy, Align Alignment, unsigned AddressSpace=0, const Value *StrideVal=nullptr)
const Instruction * getInst() const
A set of analyses that are preserved following a run of a transformation pass.
Analysis providing profile information.
The RecurrenceDescriptor is used to identify recurrences variables in a loop.
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...
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.
An instruction for storing to memory.
Analysis pass providing the TargetTransformInfo.
TargetIRAnalysis(const TargetIRAnalysis &Arg)
TargetIRAnalysis & operator=(const TargetIRAnalysis &RHS)
LLVM_ABI Result run(const Function &F, FunctionAnalysisManager &)
TargetTransformInfo Result
LLVM_ABI TargetIRAnalysis()
Default construct a target IR analysis.
TargetIRAnalysis & operator=(TargetIRAnalysis &&RHS)
TargetIRAnalysis(TargetIRAnalysis &&Arg)
Provides information about what library functions are available for the current target.
The instances of the Type class are immutable: once they are created, they are never changed.
This is the common base class for vector predication intrinsics.
LLVM Value Representation.
Base class of all SIMD vector types.
An efficient, type-erasing, non-owning reference to a callable.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
This namespace contains an enum with a value for every intrinsic/builtin function known by LLVM.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
This is an optimization pass for GlobalISel generic memory operations.
@ Known
Known to have no common set bits.
@ LLVM_MARK_AS_BITMASK_ENUM
VectorInstrContext
Represents a hint about the context in which a vector instruction or intrinsic is used.
@ None
The instruction is not folded.
@ BinaryOp
One of the operands is a binary op.
@ SplatOpFolded
All of the value's users support splatting the value.
@ Load
The value being inserted comes from a load (InsertElement only).
@ Store
The extracted value is stored (ExtractElement only).
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
AtomicOrdering
Atomic ordering for LLVM's memory model.
LLVM_ABI ImmutablePass * createTargetTransformInfoWrapperPass(TargetIRAnalysis TIRA)
Create an analysis pass wrapper around a TTI object.
RecurKind
These are the kinds of recurrences that we support.
@ Fast
Assign the register banks as fast as possible (default).
ArrayRef(const T &OneElt) -> ArrayRef< T >
constexpr unsigned BitWidth
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
@ DataWithEVL
Use predicated EVL instructions for tail-folding.
@ DataAndControlFlow
Use predicate to control both data and control flow.
@ DataWithoutLaneMask
Same as Data, but avoids using the get.active.lane.mask intrinsic to calculate the mask and instead i...
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
ValueUniformity
Enum describing how values behave with respect to uniformity and divergence, to answer the question: ...
Implement std::hash so that hash_code can be used in STL containers.
This struct is a compact representation of a valid (non-zero power of two) alignment.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
Costs for each cost kind in a target cost table.
std::optional< unsigned > operator[](TargetTransformInfo::TargetCostKind Kind) const
unsigned RecipThroughputCost
unsigned SizeAndLatencyCost
Attributes of a target dependent hardware loop.
LLVM_ABI bool canAnalyze(LoopInfo &LI)
HardwareLoopInfo()=delete
LLVM_ABI bool isHardwareLoopCandidate(ScalarEvolution &SE, LoopInfo &LI, DominatorTree &DT, bool ForceNestedLoop=false, bool ForceHardwareLoopPHI=false)
Information about a load/store intrinsic defined by the target.
SmallVector< InterestingMemoryOperand, 1 > InterestingOperands
unsigned short MatchingId
Value * PtrVal
This is the pointer that the intrinsic is loading from or storing to.
InterleavedAccessInfo * IAI
TailFoldingInfo(TargetLibraryInfo *TLI, LoopVectorizationLegality *LVL, InterleavedAccessInfo *IAI)
LoopVectorizationLegality * LVL