LLVM 23.0.0git
X86TargetTransformInfo.h
Go to the documentation of this file.
1//===-- X86TargetTransformInfo.h - X86 specific TTI -------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8/// \file
9/// This file a TargetTransformInfoImplBase conforming object specific to the
10/// X86 target machine. It uses the target's detailed information to
11/// provide more precise answers to certain TTI queries, while letting the
12/// target independent and default TTI implementations handle the rest.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_LIB_TARGET_X86_X86TARGETTRANSFORMINFO_H
17#define LLVM_LIB_TARGET_X86_X86TARGETTRANSFORMINFO_H
18
19#include "X86TargetMachine.h"
22#include <optional>
23
24namespace llvm {
25
26class InstCombiner;
27
28class X86TTIImpl final : public BasicTTIImplBase<X86TTIImpl> {
29 typedef BasicTTIImplBase<X86TTIImpl> BaseT;
30 typedef TargetTransformInfo TTI;
31 friend BaseT;
32
33 const X86Subtarget *ST;
34 const X86TargetLowering *TLI;
35
36 const X86Subtarget *getST() const { return ST; }
37 const X86TargetLowering *getTLI() const { return TLI; }
38
39 const FeatureBitset InlineFeatureIgnoreList = {
40 // clang-format off
41 // This indicates the CPU is 64 bit capable not that we are in 64-bit
42 // mode.
43 X86::FeatureX86_64,
44
45 // These features don't have any intrinsics or ABI effect.
46 X86::FeatureNOPL,
47 X86::FeatureCX16,
48 X86::FeatureLAHFSAHF64,
49
50 // Some older targets can be setup to fold unaligned loads.
51 X86::FeatureSSEUnalignedMem,
52
53 // Codegen control options.
54 X86::TuningFast11ByteNOP,
55 X86::TuningFast15ByteNOP,
56 X86::TuningFastBEXTR,
57 X86::TuningFastHorizontalOps,
58 X86::TuningFastLZCNT,
59 X86::TuningFastScalarFSQRT,
60 X86::TuningFastSHLDRotate,
61 X86::TuningFastScalarShiftMasks,
62 X86::TuningFastVectorShiftMasks,
63 X86::TuningFastVariableCrossLaneShuffle,
64 X86::TuningFastVariablePerLaneShuffle,
65 X86::TuningFastVectorFSQRT,
66 X86::TuningLEAForSP,
67 X86::TuningLEAUsesAG,
68 X86::TuningLZCNTFalseDeps,
69 X86::TuningBranchFusion,
70 X86::TuningMacroFusion,
71 X86::TuningPadShortFunctions,
72 X86::TuningPOPCNTFalseDeps,
73 X86::TuningMULCFalseDeps,
74 X86::TuningPERMFalseDeps,
75 X86::TuningRANGEFalseDeps,
76 X86::TuningGETMANTFalseDeps,
77 X86::TuningMULLQFalseDeps,
78 X86::TuningSlow3OpsLEA,
79 X86::TuningSlowDivide32,
80 X86::TuningSlowDivide64,
81 X86::TuningSlowIncDec,
82 X86::TuningSlowIndirectCall,
83 X86::TuningSlowLEA,
84 X86::TuningSlowPMADDWD,
85 X86::TuningSlowPMULLD,
86 X86::TuningSlowSHLD,
87 X86::TuningSlowTwoMemOps,
88 X86::TuningSlowUAMem16,
89 X86::TuningPreferMaskRegisters,
90 X86::TuningInsertVZEROUPPER,
91 X86::TuningUseSLMArithCosts,
92 X86::TuningUseGLMDivSqrtCosts,
93 X86::TuningNoDomainDelay,
94 X86::TuningNoDomainDelayMov,
95 X86::TuningNoDomainDelayShuffle,
96 X86::TuningNoDomainDelayBlend,
97 X86::TuningPreferShiftShuffle,
98 X86::TuningFastImmVectorShift,
99 X86::TuningFastDPWSSD,
100
101 // Perf-tuning flags.
102 X86::TuningFastGather,
103 X86::TuningSlowUAMem32,
104 X86::TuningAllowLight256Bit,
105
106 // Based on whether user set the -mprefer-vector-width command line.
107 X86::TuningPrefer128Bit,
108 X86::TuningPrefer256Bit,
109
110 // CPU name enums. These just follow CPU string.
111 X86::ProcIntelAtom
112 // clang-format on
113 };
114
115public:
116 explicit X86TTIImpl(const X86TargetMachine *TM, const Function &F)
117 : BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)),
118 TLI(ST->getTargetLowering()) {}
119
120 /// \name Scalar TTI Implementations
121 /// @{
122 TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth) const override;
123
124 /// @}
125
126 /// \name Cache TTI Implementation
127 /// @{
128 std::optional<unsigned> getCacheSize(
129 TargetTransformInfo::CacheLevel Level) const override;
130 std::optional<unsigned> getCacheAssociativity(
131 TargetTransformInfo::CacheLevel Level) const override;
132 /// @}
133
134 /// \name Vector TTI Implementations
135 /// @{
136
137 unsigned getNumberOfRegisters(unsigned ClassID) const override;
138 unsigned getRegisterClassForType(bool Vector, Type *Ty) const override;
139 bool hasConditionalLoadStoreForType(Type *Ty, bool IsStore) const override;
142 unsigned getLoadStoreVecRegBitWidth(unsigned AS) const override;
143 unsigned getMaxInterleaveFactor(ElementCount VF) const override;
145 unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
149 const Instruction *CxtI = nullptr) const override;
150 InstructionCost getAltInstrCost(VectorType *VecTy, unsigned Opcode0,
151 unsigned Opcode1,
152 const SmallBitVector &OpcodeMask,
153 TTI::TargetCostKind CostKind) const override;
154
156 getShuffleCost(TTI::ShuffleKind Kind, VectorType *DstTy, VectorType *SrcTy,
157 ArrayRef<int> Mask, TTI::TargetCostKind CostKind, int Index,
158 VectorType *SubTp, ArrayRef<const Value *> Args = {},
159 const Instruction *CxtI = nullptr) const override;
161 getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
163 const Instruction *I = nullptr) const override;
165 unsigned Opcode, Type *ValTy, Type *CondTy, CmpInst::Predicate VecPred,
169 const Instruction *I = nullptr) const override;
173 unsigned Index, const Value *Op0, const Value *Op1,
175 TTI::VectorInstrContext::None) const override;
177 getScalarizationOverhead(VectorType *Ty, const APInt &DemandedElts,
178 bool Insert, bool Extract,
180 bool ForPoisonSrc = true, ArrayRef<Value *> VL = {},
182 TTI::VectorInstrContext::None) const override;
184 getReplicationShuffleCost(Type *EltTy, int ReplicationFactor, int VF,
185 const APInt &DemandedDstElts,
186 TTI::TargetCostKind CostKind) const override;
188 unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace,
191 const Instruction *I = nullptr) const override;
193 getMemIntrinsicInstrCost(const MemIntrinsicCostAttributes &MICA,
194 TTI::TargetCostKind CostKind) const override;
195 InstructionCost getMaskedMemoryOpCost(const MemIntrinsicCostAttributes &MICA,
197 InstructionCost getGatherScatterOpCost(const MemIntrinsicCostAttributes &MICA,
201 const TTI::PointersChainInfo &Info, Type *AccessTy,
202 TTI::TargetCostKind CostKind) const override;
204 getAddressComputationCost(Type *PtrTy, ScalarEvolution *SE, const SCEV *Ptr,
205 TTI::TargetCostKind CostKind) const override;
206
207 std::optional<Instruction *>
208 instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const override;
209 std::optional<Value *>
211 APInt DemandedMask, KnownBits &Known,
212 bool &KnownBitsComputed) const override;
213 std::optional<Value *> simplifyDemandedVectorEltsIntrinsic(
214 InstCombiner &IC, IntrinsicInst &II, APInt DemandedElts, APInt &UndefElts,
215 APInt &UndefElts2, APInt &UndefElts3,
216 std::function<void(Instruction *, unsigned, APInt, APInt &)>
217 SimplifyAndSetOp) const override;
218
219 unsigned getAtomicMemIntrinsicMaxElementSize() const override;
220
222 getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
223 TTI::TargetCostKind CostKind) const override;
224
226 getArithmeticReductionCost(unsigned Opcode, VectorType *Ty,
227 std::optional<FastMathFlags> FMF,
228 TTI::TargetCostKind CostKind) const override;
229
231 unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType,
233 TTI::PartialReductionExtendKind OpBExtend, std::optional<unsigned> BinOp,
235 std::optional<FastMathFlags> FMF) const override {
237 }
238
241 FastMathFlags FMF) const;
242
245 TTI::TargetCostKind CostKind) const override;
246
248 unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef<unsigned> Indices,
249 Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind,
250 bool UseMaskForCond = false, bool UseMaskForGaps = false) const override;
252 unsigned Opcode, FixedVectorType *VecTy, unsigned Factor,
253 ArrayRef<unsigned> Indices, Align Alignment, unsigned AddressSpace,
254 TTI::TargetCostKind CostKind, bool UseMaskForCond = false,
255 bool UseMaskForGaps = false) const;
256
257 InstructionCost getIntImmCost(int64_t) const;
258
259 InstructionCost getIntImmCost(const APInt &Imm, Type *Ty,
260 TTI::TargetCostKind CostKind) const override;
261
263 const Instruction *I = nullptr) const override;
264
265 InstructionCost getIntImmCostInst(unsigned Opcode, unsigned Idx,
266 const APInt &Imm, Type *Ty,
268 Instruction *Inst = nullptr) const override;
270 getIntImmCostIntrin(Intrinsic::ID IID, unsigned Idx, const APInt &Imm,
271 Type *Ty, TTI::TargetCostKind CostKind) const override;
272 /// Return the cost of the scaling factor used in the addressing
273 /// mode represented by AM for this target, for a load/store
274 /// of the specified type.
275 /// If the AM is supported, the return value must be >= 0.
276 /// If the AM is not supported, it returns an invalid cost.
278 StackOffset BaseOffset, bool HasBaseReg,
279 int64_t Scale,
280 unsigned AddrSpace) const override;
281
283 const TargetTransformInfo::LSRCost &C2) const override;
284 bool canMacroFuseCmp() const override;
285 bool
286 isLegalMaskedLoad(Type *DataType, Align Alignment, unsigned AddressSpace,
287 TTI::MaskKind MaskKind =
289 bool
290 isLegalMaskedStore(Type *DataType, Align Alignment, unsigned AddressSpace,
291 TTI::MaskKind MaskKind =
293 bool isLegalNTLoad(Type *DataType, Align Alignment) const override;
294 bool isLegalNTStore(Type *DataType, Align Alignment) const override;
295 bool isLegalBroadcastLoad(Type *ElementTy,
296 ElementCount NumElements) const override;
298 Align Alignment) const override;
300 Align Alignment) const override {
301 return forceScalarizeMaskedGather(VTy, Alignment);
302 }
303 bool isLegalMaskedGatherScatter(Type *DataType, Align Alignment) const;
304 bool isLegalMaskedGather(Type *DataType, Align Alignment) const override;
305 bool isLegalMaskedScatter(Type *DataType, Align Alignment) const override;
306 bool isLegalMaskedExpandLoad(Type *DataType, Align Alignment) const override;
307 bool isLegalMaskedCompressStore(Type *DataType,
308 Align Alignment) const override;
309 bool isLegalAltInstr(VectorType *VecTy, unsigned Opcode0, unsigned Opcode1,
310 const SmallBitVector &OpcodeMask) const override;
311 bool hasDivRemOp(Type *DataType, bool IsSigned) const override;
312 bool isExpensiveToSpeculativelyExecute(const Instruction *I) const override;
313 bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) const override;
314 bool areInlineCompatible(const Function *Caller,
315 const Function *Callee) const override;
316 bool areTypesABICompatible(const Function *Caller, const Function *Callee,
317 ArrayRef<Type *> Type) const override;
318
320 return ST->getMaxInlineSizeThreshold();
321 }
322
324 enableMemCmpExpansion(bool OptSize, bool IsZeroCmp) const override;
325 bool preferAlternateOpcodeVectorization() const override { return false; }
326 bool prefersVectorizedAddressing() const override;
327 bool supportsEfficientVectorElementLoadStore() const override;
328 bool enableInterleavedAccessVectorization() const override;
329
331
333 SmallVectorImpl<Use *> &Ops) const override;
334
335 bool isVectorShiftByScalarCheap(Type *Ty) const override;
336
337 unsigned getStoreMinimumVF(unsigned VF, Type *ScalarMemTy, Type *ScalarValTy,
338 Align Alignment,
339 unsigned AddrSpace) const override;
340
341 bool useFastCCForInternalCall(Function &F) const override;
342
343private:
344 bool supportsGather() const;
345 InstructionCost getGSVectorCost(unsigned Opcode, TTI::TargetCostKind CostKind,
346 Type *DataTy, const Value *Ptr,
347 Align Alignment, unsigned AddressSpace) const;
348
349 int getGatherOverhead() const;
350 int getScatterOverhead() const;
351
352 /// @}
353};
354
355} // end namespace llvm
356
357#endif
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
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")))
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
#define F(x, y, z)
Definition MD5.cpp:54
#define I(x, y, z)
Definition MD5.cpp:57
Machine InstCombiner
uint64_t IntrinsicInst * II
This pass exposes codegen information to IR-level passes.
Class for arbitrary precision integers.
Definition APInt.h:78
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, const Value *Op0, const Value *Op1, TTI::VectorInstrContext VIC=TTI::VectorInstrContext::None) const override
BasicTTIImplBase(const TargetMachine *TM, const DataLayout &DL)
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition InstrTypes.h:676
Convenience struct for specifying and reasoning about fast-math flags.
Definition FMF.h:23
Container class for subtarget features.
Class to represent fixed width SIMD vectors.
The core instruction combiner logic.
static InstructionCost getInvalid(CostType Val=0)
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...
StackOffset holds a fixed and a scalable offset in bytes.
Definition TypeSize.h:30
virtual const DataLayout & getDataLayout() const
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
VectorInstrContext
Represents a hint about the context in which an insert/extract is used.
@ None
The insert/extract is not used with a load/store.
MaskKind
Some targets only support masked load/store with a constant mask.
TargetCostKind
The kind of cost model.
PopcntSupportKind
Flags indicating the kind of support for population count.
ShuffleKind
The various kinds of shuffle patterns for vector queries.
CastContextHint
Represents a hint about the context in which a cast is used.
CacheLevel
The possible cache levels.
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:46
LLVM Value Representation.
Definition Value.h:75
Base class of all SIMD vector types.
bool useFastCCForInternalCall(Function &F) const override
InstructionCost getReplicationShuffleCost(Type *EltTy, int ReplicationFactor, int VF, const APInt &DemandedDstElts, TTI::TargetCostKind CostKind) const override
bool isLegalNTLoad(Type *DataType, Align Alignment) const override
unsigned getMaxInterleaveFactor(ElementCount VF) const override
std::optional< unsigned > getCacheAssociativity(TargetTransformInfo::CacheLevel Level) const override
InstructionCost getMinMaxReductionCost(Intrinsic::ID IID, VectorType *Ty, FastMathFlags FMF, TTI::TargetCostKind CostKind) const override
Try to calculate op costs for min/max reduction operations.
bool isLegalBroadcastLoad(Type *ElementTy, ElementCount NumElements) const override
unsigned getRegisterClassForType(bool Vector, Type *Ty) const override
InstructionCost getMemIntrinsicInstrCost(const MemIntrinsicCostAttributes &MICA, TTI::TargetCostKind CostKind) const override
Get memory intrinsic cost based on arguments.
InstructionCost getPartialReductionCost(unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType, ElementCount VF, TTI::PartialReductionExtendKind OpAExtend, TTI::PartialReductionExtendKind OpBExtend, std::optional< unsigned > BinOp, TTI::TargetCostKind CostKind, std::optional< FastMathFlags > FMF) const override
bool preferAlternateOpcodeVectorization() const override
InstructionCost getShuffleCost(TTI::ShuffleKind Kind, VectorType *DstTy, VectorType *SrcTy, ArrayRef< int > Mask, TTI::TargetCostKind CostKind, int Index, VectorType *SubTp, ArrayRef< const Value * > Args={}, const Instruction *CxtI=nullptr) const override
X86TTIImpl(const X86TargetMachine *TM, const Function &F)
bool isLegalNTStore(Type *DataType, Align Alignment) const override
InstructionCost getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src, TTI::CastContextHint CCH, TTI::TargetCostKind CostKind, const Instruction *I=nullptr) const override
InstructionCost getInterleavedMemoryOpCostAVX512(unsigned Opcode, FixedVectorType *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, bool UseMaskForCond=false, bool UseMaskForGaps=false) const
bool isLegalAltInstr(VectorType *VecTy, unsigned Opcode0, unsigned Opcode1, const SmallBitVector &OpcodeMask) const override
TypeSize getRegisterBitWidth(TargetTransformInfo::RegisterKind K) const override
bool isVectorShiftByScalarCheap(Type *Ty) const override
bool isLegalMaskedGather(Type *DataType, Align Alignment) const override
InstructionCost getScalingFactorCost(Type *Ty, GlobalValue *BaseGV, StackOffset BaseOffset, bool HasBaseReg, int64_t Scale, unsigned AddrSpace) const override
Return the cost of the scaling factor used in the addressing mode represented by AM for this target,...
unsigned getAtomicMemIntrinsicMaxElementSize() const override
InstructionCost getPointersChainCost(ArrayRef< const Value * > Ptrs, const Value *Base, const TTI::PointersChainInfo &Info, Type *AccessTy, TTI::TargetCostKind CostKind) const override
bool forceScalarizeMaskedGather(VectorType *VTy, Align Alignment) const override
InstructionCost getBranchMispredictPenalty() const override
bool isExpensiveToSpeculativelyExecute(const Instruction *I) const override
bool hasConditionalLoadStoreForType(Type *Ty, bool IsStore) const override
bool isLegalMaskedStore(Type *DataType, Align Alignment, unsigned AddressSpace, TTI::MaskKind MaskKind=TTI::MaskKind::VariableOrConstantMask) const override
std::optional< unsigned > getCacheSize(TargetTransformInfo::CacheLevel Level) const override
InstructionCost getArithmeticInstrCost(unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind, TTI::OperandValueInfo Op1Info={TTI::OK_AnyValue, TTI::OP_None}, TTI::OperandValueInfo Op2Info={TTI::OK_AnyValue, TTI::OP_None}, ArrayRef< const Value * > Args={}, const Instruction *CxtI=nullptr) const override
bool isLegalMaskedGatherScatter(Type *DataType, Align Alignment) const
bool isLegalMaskedLoad(Type *DataType, Align Alignment, unsigned AddressSpace, TTI::MaskKind MaskKind=TTI::MaskKind::VariableOrConstantMask) const override
bool enableInterleavedAccessVectorization() const override
unsigned getLoadStoreVecRegBitWidth(unsigned AS) const override
unsigned getNumberOfRegisters(unsigned ClassID) const override
std::optional< Value * > simplifyDemandedUseBitsIntrinsic(InstCombiner &IC, IntrinsicInst &II, APInt DemandedMask, KnownBits &Known, bool &KnownBitsComputed) const override
uint64_t getMaxMemIntrinsicInlineSizeThreshold() const override
InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, const Value *Op0, const Value *Op1, TTI::VectorInstrContext VIC=TTI::VectorInstrContext::None) const override
bool isLegalMaskedScatter(Type *DataType, Align Alignment) const override
unsigned getStoreMinimumVF(unsigned VF, Type *ScalarMemTy, Type *ScalarValTy, Align Alignment, unsigned AddrSpace) const override
bool hasDivRemOp(Type *DataType, bool IsSigned) const override
bool isLegalMaskedCompressStore(Type *DataType, Align Alignment) const override
InstructionCost getIntImmCostIntrin(Intrinsic::ID IID, unsigned Idx, const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind) const override
std::optional< Value * > simplifyDemandedVectorEltsIntrinsic(InstCombiner &IC, IntrinsicInst &II, APInt DemandedElts, APInt &UndefElts, APInt &UndefElts2, APInt &UndefElts3, std::function< void(Instruction *, unsigned, APInt, APInt &)> SimplifyAndSetOp) const override
bool supportsEfficientVectorElementLoadStore() const override
InstructionCost getIntImmCostInst(unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind, Instruction *Inst=nullptr) const override
bool isLegalMaskedExpandLoad(Type *DataType, Align Alignment) const override
TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth) const override
bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) const override
TTI::MemCmpExpansionOptions enableMemCmpExpansion(bool OptSize, bool IsZeroCmp) const override
InstructionCost getIntImmCost(int64_t) const
Calculate the cost of materializing a 64-bit value.
InstructionCost getMinMaxCost(Intrinsic::ID IID, Type *Ty, TTI::TargetCostKind CostKind, FastMathFlags FMF) const
InstructionCost getCFInstrCost(unsigned Opcode, TTI::TargetCostKind CostKind, const Instruction *I=nullptr) const override
InstructionCost getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, bool UseMaskForCond=false, bool UseMaskForGaps=false) const override
bool canMacroFuseCmp() const override
bool areInlineCompatible(const Function *Caller, const Function *Callee) const override
InstructionCost getMaskedMemoryOpCost(const MemIntrinsicCostAttributes &MICA, TTI::TargetCostKind CostKind) const
bool prefersVectorizedAddressing() const override
bool areTypesABICompatible(const Function *Caller, const Function *Callee, ArrayRef< Type * > Type) const override
InstructionCost getAltInstrCost(VectorType *VecTy, unsigned Opcode0, unsigned Opcode1, const SmallBitVector &OpcodeMask, TTI::TargetCostKind CostKind) const override
bool forceScalarizeMaskedScatter(VectorType *VTy, Align Alignment) const override
InstructionCost getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind) const override
Get intrinsic cost based on arguments.
bool isProfitableToSinkOperands(Instruction *I, SmallVectorImpl< Use * > &Ops) const override
InstructionCost getScalarizationOverhead(VectorType *Ty, const APInt &DemandedElts, bool Insert, bool Extract, TTI::TargetCostKind CostKind, bool ForPoisonSrc=true, ArrayRef< Value * > VL={}, TTI::VectorInstrContext VIC=TTI::VectorInstrContext::None) const override
Estimate the overhead of scalarizing an instruction.
InstructionCost getArithmeticReductionCost(unsigned Opcode, VectorType *Ty, std::optional< FastMathFlags > FMF, TTI::TargetCostKind CostKind) const override
InstructionCost getGatherScatterOpCost(const MemIntrinsicCostAttributes &MICA, TTI::TargetCostKind CostKind) const
Calculate the cost of Gather / Scatter operation.
std::optional< Instruction * > instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const override
InstructionCost getMemoryOpCost(unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, TTI::OperandValueInfo OpInfo={TTI::OK_AnyValue, TTI::OP_None}, const Instruction *I=nullptr) const override
InstructionCost getAddressComputationCost(Type *PtrTy, ScalarEvolution *SE, const SCEV *Ptr, TTI::TargetCostKind CostKind) const override
InstructionCost getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy, CmpInst::Predicate VecPred, TTI::TargetCostKind CostKind, TTI::OperandValueInfo Op1Info={TTI::OK_AnyValue, TTI::OP_None}, TTI::OperandValueInfo Op2Info={TTI::OK_AnyValue, TTI::OP_None}, const Instruction *I=nullptr) const override
bool isLSRCostLess(const TargetTransformInfo::LSRCost &C1, const TargetTransformInfo::LSRCost &C2) const override
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Definition BasicBlock.h:73
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
Definition InstrProf.h:137
ArrayRef(const T &OneElt) -> ArrayRef< T >
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39
Returns options for expansion of memcmp. IsZeroCmp is.
Describe known properties for a set of pointers.