21#ifndef LLVM_ANALYSIS_TARGETTRANSFORMINFO_H
22#define LLVM_ANALYSIS_TARGETTRANSFORMINFO_H
47class BlockFrequencyInfo;
53class OptimizationRemarkEmitter;
54class InterleavedAccessInfo;
59class LoopVectorizationLegality;
60class ProfileSummaryInfo;
61class RecurrenceDescriptor;
67class TargetLibraryInfo;
124 Type *RetTy =
nullptr;
213class TargetTransformInfo;
233 std::unique_ptr<const TargetTransformInfoImplBase> Impl);
346 static_assert(
sizeof(PointersChainInfo) == 4,
"Was size increase justified?");
354 const PointersChainInfo &
Info,
Type *AccessTy,
507 LLVM_ABI std::pair<const Value *, unsigned>
707 LLVM_ABI std::optional<Instruction *>
714 bool &KnownBitsComputed)
const;
721 SimplifyAndSetOp)
const;
765 int64_t BaseOffset,
bool HasBaseReg,
766 int64_t Scale,
unsigned AddrSpace = 0,
768 int64_t ScalableOffset = 0)
const;
831 Align Alignment)
const;
835 Align Alignment)
const;
839 Align Alignment)
const;
851 unsigned AddrSpace)
const;
855 Type *DataType)
const;
896 bool HasBaseReg, int64_t Scale,
897 unsigned AddrSpace = 0)
const;
941 unsigned ScalarOpdIdx)
const;
1022 bool IsZeroCmp)
const;
1055 unsigned *
Fast =
nullptr)
const;
1201 Type *Ty =
nullptr)
const;
1254 Type *ScalarValTy)
const;
1260 const Instruction &
I,
bool &AllowPromotionWithoutCommonHeader)
const;
1308 unsigned NumStridedMemAccesses,
1309 unsigned NumPrefetches,
1310 bool HasCall)
const;
1343 unsigned Opcode,
Type *InputTypeA,
Type *InputTypeB,
Type *AccumType,
1375 unsigned Opcode,
Type *Ty,
1379 ArrayRef<const Value *>
Args = {},
const Instruction *CxtI =
nullptr,
1380 const TargetLibraryInfo *TLibInfo =
nullptr)
const;
1390 VectorType *VecTy,
unsigned Opcode0,
unsigned Opcode1,
1391 const SmallBitVector &OpcodeMask,
1403 ArrayRef<int> Mask = {},
1406 const Instruction *CxtI =
nullptr)
const;
1476 const Instruction *
I =
nullptr)
const;
1485 unsigned Index = -1,
1486 const Value *Op0 =
nullptr,
1487 const Value *Op1 =
nullptr)
const;
1501 ArrayRef<std::tuple<Value *, User *, int>> ScalarUserAndIdx)
const;
1511 unsigned Index = -1)
const;
1519 unsigned Index)
const;
1533 Type *EltTy,
int ReplicationFactor,
int VF,
const APInt &DemandedDstElts,
1538 unsigned Opcode, Type *Src, Align Alignment,
unsigned AddressSpace,
1541 const Instruction *
I =
nullptr)
const;
1564 unsigned Opcode,
Type *DataTy,
const Value *
Ptr,
bool VariableMask,
1577 unsigned Opcode,
Type *DataTy,
bool VariableMask,
Align Alignment,
1591 unsigned Opcode,
Type *DataTy,
const Value *
Ptr,
bool VariableMask,
1609 bool UseMaskForCond =
false,
bool UseMaskForGaps =
false)
const;
1614 return FMF && !(*FMF).allowReassoc();
1642 unsigned Opcode,
VectorType *Ty, std::optional<FastMathFlags> FMF,
1664 std::optional<FastMathFlags> FMF,
1718 bool CanCreate =
true)
const;
1723 unsigned DestAddrSpace,
Align SrcAlign,
Align DestAlign,
1724 std::optional<uint32_t> AtomicElementSize = std::nullopt)
const;
1734 unsigned RemainingBytes,
unsigned SrcAddrSpace,
unsigned DestAddrSpace,
1736 std::optional<uint32_t> AtomicCpySize = std::nullopt)
const;
1751 unsigned DefaultCallPenalty)
const;
1789 unsigned AddrSpace)
const;
1794 unsigned AddrSpace)
const;
1806 unsigned ChainSizeInBytes,
1812 unsigned ChainSizeInBytes,
1965 std::unique_ptr<const TargetTransformInfoImplBase> TTIImpl;
1998 : TTICallback(Arg.TTICallback) {}
2000 : TTICallback(
std::
move(Arg.TTICallback)) {}
2002 TTICallback =
RHS.TTICallback;
2006 TTICallback = std::move(
RHS.TTICallback);
2038 std::optional<TargetTransformInfo>
TTI;
2040 virtual void anchor();
AMDGPU Lower Kernel Arguments
This file implements a class to represent arbitrary precision integral constant values and operations...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Atomic ordering constants.
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 cl::opt< bool > ForceNestedLoop("force-nested-hardware-loop", cl::Hidden, cl::init(false), cl::desc("Force allowance of nested hardware loops"))
static cl::opt< bool > ForceHardwareLoopPHI("force-hardware-loop-phi", cl::Hidden, cl::init(false), cl::desc("Force hardware loop counter to be updated through a phi"))
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,...
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")))
Class for arbitrary precision integers.
an instruction to allocate memory on the stack
API to communicate dependencies between analyses during invalidation.
A container for analyses that lazily runs them and caches their results.
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.
LLVM Basic Block Representation.
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 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.
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 TargetLibraryInfo * getLibInfo() const
const SmallVectorImpl< Type * > & getArgTypes() const
Type * getReturnType() const
bool skipScalarizationCost() const
const SmallVectorImpl< const Value * > & getArgs() 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.
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.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
@ Fast
Attempts to make calls as fast as possible (e.g.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
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.
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.
@ DataAndControlFlowWithoutRuntimeCheck
Use predicate to control both data and control flow, but modify the trip count so that a runtime over...
@ 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...
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...
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.
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