LLVM 23.0.0git
ARMTargetTransformInfo.h
Go to the documentation of this file.
1//===- ARMTargetTransformInfo.h - ARM 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//
9/// \file
10/// This file a TargetTransformInfoImplBase conforming object specific to the
11/// ARM target machine. It uses the target's detailed information to
12/// provide more precise answers to certain TTI queries, while letting the
13/// target independent and default TTI implementations handle the rest.
14//
15//===----------------------------------------------------------------------===//
16
17#ifndef LLVM_LIB_TARGET_ARM_ARMTARGETTRANSFORMINFO_H
18#define LLVM_LIB_TARGET_ARM_ARMTARGETTRANSFORMINFO_H
19
20#include "ARM.h"
21#include "ARMSubtarget.h"
22#include "ARMTargetMachine.h"
23#include "llvm/ADT/ArrayRef.h"
26#include "llvm/IR/Constant.h"
27#include "llvm/IR/Function.h"
29#include <optional>
30
31namespace llvm {
32
33class APInt;
35class Instruction;
36class Loop;
37class SCEV;
38class ScalarEvolution;
39class Type;
40class Value;
41
51
52// For controlling conversion of memcpy into Tail Predicated loop.
53namespace TPLoop {
55}
56
57class ARMTTIImpl final : public BasicTTIImplBase<ARMTTIImpl> {
58 using BaseT = BasicTTIImplBase<ARMTTIImpl>;
59 using TTI = TargetTransformInfo;
60
61 friend BaseT;
62
63 const ARMSubtarget *ST;
64 const ARMTargetLowering *TLI;
65
66 // Currently the following features are excluded from InlineFeaturesAllowed.
67 // ModeThumb, FeatureNoARM, ModeSoftFloat.
68 // Depending on whether they are set or unset, different
69 // instructions/registers are available. For example, inlining a callee with
70 // -thumb-mode in a caller with +thumb-mode, may cause the assembler to
71 // fail if the callee uses ARM only instructions, e.g. in inline asm.
72 const FeatureBitset InlineFeaturesAllowed = {ARM::Feature8MSecExt,
73 ARM::FeatureAClass,
74 ARM::FeatureAES,
75 ARM::FeatureAcquireRelease,
76 ARM::FeatureAvoidMOVsShOp,
77 ARM::FeatureAvoidMULS,
78 ARM::FeatureAvoidPartialCPSR,
79 ARM::FeatureBF16,
80 ARM::FeatureCRC,
81 ARM::FeatureCheapPredicableCPSR,
82 ARM::FeatureCheckVLDnAlign,
83 ARM::FeatureCrypto,
84 ARM::FeatureD32,
85 ARM::FeatureDB,
86 ARM::FeatureDFB,
87 ARM::FeatureDSP,
88 ARM::FeatureDontWidenVMOVS,
89 ARM::FeatureDotProd,
90 ARM::FeatureExecuteOnly,
91 ARM::FeatureExpandMLx,
92 ARM::FeatureFP16,
93 ARM::FeatureFP16FML,
94 ARM::FeatureFP64,
95 ARM::FeatureFPAO,
96 ARM::FeatureFPARMv8,
97 ARM::FeatureFPARMv8_D16,
98 ARM::FeatureFPARMv8_D16_SP,
99 ARM::FeatureFPARMv8_SP,
100 ARM::FeatureFPRegs,
101 ARM::FeatureFPRegs16,
102 ARM::FeatureFPRegs64,
103 ARM::FeatureFullFP16,
104 ARM::FeatureFuseAES,
105 ARM::FeatureFuseLiterals,
106 ARM::FeatureHWDivARM,
107 ARM::FeatureHWDivThumb,
108 ARM::FeatureHasNoBranchPredictor,
109 ARM::FeatureHasRetAddrStack,
110 ARM::FeatureHasSlowFPVFMx,
111 ARM::FeatureHasSlowFPVMLx,
112 ARM::FeatureHasVMLxHazards,
113 ARM::FeatureLOB,
114 ARM::FeatureLongCalls,
115 ARM::FeatureMClass,
116 ARM::FeatureMP,
117 ARM::FeatureMVEVectorCostFactor1,
118 ARM::FeatureMVEVectorCostFactor2,
119 ARM::FeatureMVEVectorCostFactor4,
120 ARM::FeatureMatMulInt8,
121 ARM::FeatureMuxedUnits,
122 ARM::FeatureNEON,
123 ARM::FeatureNEONForFP,
124 ARM::FeatureNEONForFPMovs,
125 ARM::FeatureNoMovt,
126 ARM::FeatureNoNegativeImmediates,
127 ARM::FeatureNoPostRASched,
128 ARM::FeaturePerfMon,
129 ARM::FeaturePref32BitThumb,
130 ARM::FeaturePrefISHSTBarrier,
131 ARM::FeaturePreferBranchAlign32,
132 ARM::FeaturePreferBranchAlign64,
133 ARM::FeaturePreferVMOVSR,
134 ARM::FeatureProfUnpredicate,
135 ARM::FeatureRAS,
136 ARM::FeatureRClass,
137 ARM::FeatureReserveR9,
138 ARM::FeatureSB,
139 ARM::FeatureSHA2,
140 ARM::FeatureSlowFPBrcc,
141 ARM::FeatureSlowLoadDSubreg,
142 ARM::FeatureSlowOddRegister,
143 ARM::FeatureSlowVDUP32,
144 ARM::FeatureSlowVGETLNi32,
145 ARM::FeatureSplatVFPToNeon,
146 ARM::FeatureStrictAlign,
147 ARM::FeatureThumb2,
148 ARM::FeatureTrustZone,
149 ARM::FeatureUseMIPipeliner,
150 ARM::FeatureUseMISched,
151 ARM::FeatureUseWideStrideVFP,
152 ARM::FeatureV7Clrex,
153 ARM::FeatureVFP2,
154 ARM::FeatureVFP2_SP,
155 ARM::FeatureVFP3,
156 ARM::FeatureVFP3_D16,
157 ARM::FeatureVFP3_D16_SP,
158 ARM::FeatureVFP3_SP,
159 ARM::FeatureVFP4,
160 ARM::FeatureVFP4_D16,
161 ARM::FeatureVFP4_D16_SP,
162 ARM::FeatureVFP4_SP,
163 ARM::FeatureVMLxForwarding,
164 ARM::FeatureVirtualization,
165 ARM::FeatureZCZeroing,
166 ARM::HasMVEFloatOps,
167 ARM::HasMVEIntegerOps,
168 ARM::HasV5TEOps,
169 ARM::HasV5TOps,
170 ARM::HasV6KOps,
171 ARM::HasV6MOps,
172 ARM::HasV6Ops,
173 ARM::HasV6T2Ops,
174 ARM::HasV7Ops,
175 ARM::HasV8MBaselineOps,
176 ARM::HasV8MMainlineOps,
177 ARM::HasV8Ops,
178 ARM::HasV8_1MMainlineOps,
179 ARM::HasV8_1aOps,
180 ARM::HasV8_2aOps,
181 ARM::HasV8_3aOps,
182 ARM::HasV8_4aOps,
183 ARM::HasV8_5aOps,
184 ARM::HasV8_6aOps,
185 ARM::HasV8_7aOps,
186 ARM::HasV8_8aOps,
187 ARM::HasV8_9aOps,
188 ARM::HasV9_0aOps,
189 ARM::HasV9_1aOps,
190 ARM::HasV9_2aOps,
191 ARM::HasV9_3aOps,
192 ARM::HasV9_4aOps,
193 ARM::HasV9_5aOps,
194 ARM::HasV9_6aOps,
195 ARM::HasV9_7aOps};
196
197 const ARMSubtarget *getST() const { return ST; }
198 const ARMTargetLowering *getTLI() const { return TLI; }
199
200public:
201 explicit ARMTTIImpl(const ARMBaseTargetMachine *TM, const Function &F)
202 : BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)),
203 TLI(ST->getTargetLowering()) {}
204
205 bool areInlineCompatible(const Function *Caller,
206 const Function *Callee) const override;
207
208 bool enableInterleavedAccessVectorization() const override { return true; }
209
211 getPreferredAddressingMode(const Loop *L, ScalarEvolution *SE) const override;
212
213 /// Floating-point computation using ARMv8 AArch32 Advanced
214 /// SIMD instructions remains unchanged from ARMv7. Only AArch64 SIMD
215 /// and Arm MVE are IEEE-754 compliant.
217 return !ST->isTargetDarwin() && !ST->hasMVEFloatOps();
218 }
219
220 std::optional<Instruction *>
222 std::optional<Value *> simplifyDemandedVectorEltsIntrinsic(
223 InstCombiner &IC, IntrinsicInst &II, APInt DemandedElts, APInt &UndefElts,
224 APInt &UndefElts2, APInt &UndefElts3,
225 std::function<void(Instruction *, unsigned, APInt, APInt &)>
226 SimplifyAndSetOp) const override;
227
228 /// \name Scalar TTI Implementations
229 /// @{
230
231 InstructionCost getIntImmCodeSizeCost(unsigned Opcode, unsigned Idx,
232 const APInt &Imm,
233 Type *Ty) const override;
234
236 InstructionCost getIntImmCost(const APInt &Imm, Type *Ty,
237 TTI::TargetCostKind CostKind) const override;
238
239 InstructionCost getIntImmCostInst(unsigned Opcode, unsigned Idx,
240 const APInt &Imm, Type *Ty,
242 Instruction *Inst = nullptr) const override;
243
244 /// @}
245
246 /// \name Vector TTI Implementations
247 /// @{
248
249 unsigned getNumberOfRegisters(unsigned ClassID) const override {
250 bool Vector = (ClassID == 1);
251 if (Vector) {
252 if (ST->hasNEON())
253 return 16;
254 if (ST->hasMVEIntegerOps())
255 return 8;
256 return 0;
257 }
258
259 if (ST->isThumb1Only())
260 return 8;
261 return 13;
262 }
263
266 switch (K) {
268 return TypeSize::getFixed(32);
270 if (ST->hasNEON())
271 return TypeSize::getFixed(128);
272 if (ST->hasMVEIntegerOps())
273 return TypeSize::getFixed(128);
274 return TypeSize::getFixed(0);
276 return TypeSize::getScalable(0);
277 }
278 llvm_unreachable("Unsupported register kind");
279 }
280
281 unsigned getMaxInterleaveFactor(ElementCount VF) const override {
282 return ST->getMaxInterleaveFactor();
283 }
284
285 bool isProfitableLSRChainElement(Instruction *I) const override;
286
287 bool
288 isLegalMaskedLoad(Type *DataTy, Align Alignment, unsigned AddressSpace,
289 TTI::MaskKind MaskKind =
291
292 bool
293 isLegalMaskedStore(Type *DataTy, Align Alignment, unsigned AddressSpace,
294 TTI::MaskKind MaskKind =
296 return isLegalMaskedLoad(DataTy, Alignment, AddressSpace, MaskKind);
297 }
298
300 Align Alignment) const override {
301 // For MVE, we have a custom lowering pass that will already have custom
302 // legalised any gathers that we can lower to MVE intrinsics, and want to
303 // expand all the rest. The pass runs before the masked intrinsic lowering
304 // pass.
305 return true;
306 }
307
309 Align Alignment) const override {
310 return forceScalarizeMaskedGather(VTy, Alignment);
311 }
312
313 bool isLegalMaskedGather(Type *Ty, Align Alignment) const override;
314
315 bool isLegalMaskedScatter(Type *Ty, Align Alignment) const override {
316 return isLegalMaskedGather(Ty, Alignment);
317 }
318
319 InstructionCost getMemcpyCost(const Instruction *I) const override;
320
322 return ST->getMaxInlineSizeThreshold();
323 }
324
325 int getNumMemOps(const IntrinsicInst *I) const;
326
330 VectorType *SubTp, ArrayRef<const Value *> Args = {},
331 const Instruction *CxtI = nullptr) const override;
332
333 bool preferInLoopReduction(RecurKind Kind, Type *Ty) const override;
334
335 bool preferPredicatedReductionSelect() const override;
336
337 bool shouldExpandReduction(const IntrinsicInst *II) const override {
338 return false;
339 }
340
342 const Instruction *I = nullptr) const override;
343
345 getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
347 const Instruction *I = nullptr) const override;
348
350 unsigned Opcode, Type *ValTy, Type *CondTy, CmpInst::Predicate VecPred,
354 const Instruction *I = nullptr) const override;
355
357 InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val,
359 unsigned Index, const Value *Op0,
360 const Value *Op1) const override;
361
363 getAddressComputationCost(Type *Val, ScalarEvolution *SE, const SCEV *Ptr,
364 TTI::TargetCostKind CostKind) const override;
365
367 unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
371 const Instruction *CxtI = nullptr) const override;
372
374 unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace,
377 const Instruction *I = nullptr) const override;
378
380 getMemIntrinsicInstrCost(const MemIntrinsicCostAttributes &MICA,
381 TTI::TargetCostKind CostKind) const override;
382
383 InstructionCost getMaskedMemoryOpCost(const MemIntrinsicCostAttributes &MICA,
385
387 unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef<unsigned> Indices,
388 Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind,
389 bool UseMaskForCond = false, bool UseMaskForGaps = false) const override;
390
391 InstructionCost getGatherScatterOpCost(const MemIntrinsicCostAttributes &MICA,
393
395 getArithmeticReductionCost(unsigned Opcode, VectorType *ValTy,
396 std::optional<FastMathFlags> FMF,
397 TTI::TargetCostKind CostKind) const override;
399 getExtendedReductionCost(unsigned Opcode, bool IsUnsigned, Type *ResTy,
400 VectorType *ValTy, std::optional<FastMathFlags> FMF,
401 TTI::TargetCostKind CostKind) const override;
403 getMulAccReductionCost(bool IsUnsigned, unsigned RedOpcode, Type *ResTy,
404 VectorType *ValTy,
405 TTI::TargetCostKind CostKind) const override;
406
408 getMinMaxReductionCost(Intrinsic::ID IID, VectorType *Ty, FastMathFlags FMF,
409 TTI::TargetCostKind CostKind) const override;
410
412 getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
413 TTI::TargetCostKind CostKind) const override;
414
415 /// getScalingFactorCost - Return the cost of the scaling used in
416 /// addressing mode represented by AM.
417 /// If the AM is supported, the return value must be >= 0.
418 /// If the AM is not supported, the return value is an invalid cost.
419 InstructionCost getScalingFactorCost(Type *Ty, GlobalValue *BaseGV,
420 StackOffset BaseOffset, bool HasBaseReg,
421 int64_t Scale,
422 unsigned AddrSpace) const override;
423
424 bool maybeLoweredToCall(Instruction &I) const;
425 bool isLoweredToCall(const Function *F) const override;
426 bool isHardwareLoopProfitable(Loop *L, ScalarEvolution &SE,
427 AssumptionCache &AC, TargetLibraryInfo *LibInfo,
428 HardwareLoopInfo &HWLoopInfo) const override;
429 bool preferPredicateOverEpilogue(TailFoldingInfo *TFI) const override;
430 void getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
432 OptimizationRemarkEmitter *ORE) const override;
433
435 getPreferredTailFoldingStyle(bool IVUpdateMayOverflow = true) const override;
436
437 void getPeelingPreferences(Loop *L, ScalarEvolution &SE,
438 TTI::PeelingPreferences &PP) const override;
440 // In the ROPI and RWPI relocation models we can't have pointers to global
441 // variables or functions in constant data, so don't convert switches to
442 // lookup tables if any of the values would need relocation.
443 if (ST->isROPI() || ST->isRWPI())
444 return !C->needsDynamicRelocation();
445
446 return true;
447 }
448
449 bool hasArmWideBranch(bool Thumb) const override;
450
452 SmallVectorImpl<Use *> &Ops) const override;
453
454 unsigned getNumBytesToPadGlobalArray(unsigned Size,
455 Type *ArrayType) const override;
456
457 /// @}
458};
459
460/// isVREVMask - Check if a vector shuffle corresponds to a VREV
461/// instruction with the specified blocksize. (The order of the elements
462/// within each block of the vector is reversed.)
463inline bool isVREVMask(ArrayRef<int> M, EVT VT, unsigned BlockSize) {
464 assert((BlockSize == 16 || BlockSize == 32 || BlockSize == 64) &&
465 "Only possible block sizes for VREV are: 16, 32, 64");
466
467 unsigned EltSz = VT.getScalarSizeInBits();
468 if (EltSz != 8 && EltSz != 16 && EltSz != 32)
469 return false;
470
471 unsigned BlockElts = M[0] + 1;
472 // If the first shuffle index is UNDEF, be optimistic.
473 if (M[0] < 0)
474 BlockElts = BlockSize / EltSz;
475
476 if (BlockSize <= EltSz || BlockSize != BlockElts * EltSz)
477 return false;
478
479 for (unsigned i = 0, e = M.size(); i < e; ++i) {
480 if (M[i] < 0)
481 continue; // ignore UNDEF indices
482 if ((unsigned)M[i] != (i - i % BlockElts) + (BlockElts - 1 - i % BlockElts))
483 return false;
484 }
485
486 return true;
487}
488
489} // end namespace llvm
490
491#endif // LLVM_LIB_TARGET_ARM_ARMTARGETTRANSFORMINFO_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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
uint64_t IntrinsicInst * II
static const int BlockSize
Definition TarWriter.cpp:33
This pass exposes codegen information to IR-level passes.
Class for arbitrary precision integers.
Definition APInt.h:78
InstructionCost getGatherScatterOpCost(const MemIntrinsicCostAttributes &MICA, TTI::TargetCostKind CostKind) const
TypeSize getRegisterBitWidth(TargetTransformInfo::RegisterKind K) const override
InstructionCost getAddressComputationCost(Type *Val, ScalarEvolution *SE, const SCEV *Ptr, TTI::TargetCostKind CostKind) const override
TailFoldingStyle getPreferredTailFoldingStyle(bool IVUpdateMayOverflow=true) const override
bool isFPVectorizationPotentiallyUnsafe() const override
Floating-point computation using ARMv8 AArch32 Advanced SIMD instructions remains unchanged from ARMv...
InstructionCost getMaskedMemoryOpCost(const MemIntrinsicCostAttributes &MICA, TTI::TargetCostKind CostKind) const
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 getMemcpyCost(const Instruction *I) const override
bool isLegalMaskedScatter(Type *Ty, Align Alignment) const override
bool maybeLoweredToCall(Instruction &I) const
bool preferInLoopReduction(RecurKind Kind, Type *Ty) 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
InstructionCost getMulAccReductionCost(bool IsUnsigned, unsigned RedOpcode, Type *ResTy, VectorType *ValTy, TTI::TargetCostKind CostKind) 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
InstructionCost getIntImmCost(const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind) const override
bool hasArmWideBranch(bool Thumb) const override
bool shouldExpandReduction(const IntrinsicInst *II) const override
bool shouldBuildLookupTablesForConstant(Constant *C) const override
InstructionCost getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src, TTI::CastContextHint CCH, TTI::TargetCostKind CostKind, const Instruction *I=nullptr) const override
int getNumMemOps(const IntrinsicInst *I) const
Given a memcpy/memset/memmove instruction, return the number of memory operations performed,...
InstructionCost getCFInstrCost(unsigned Opcode, TTI::TargetCostKind CostKind, const Instruction *I=nullptr) const override
InstructionCost getIntImmCodeSizeCost(unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty) const override
bool isLoweredToCall(const Function *F) const override
InstructionCost getExtendedReductionCost(unsigned Opcode, bool IsUnsigned, Type *ResTy, VectorType *ValTy, std::optional< FastMathFlags > FMF, TTI::TargetCostKind CostKind) const override
bool isProfitableToSinkOperands(Instruction *I, SmallVectorImpl< Use * > &Ops) const override
Check if sinking I's operands to I's basic block is profitable, because the operands can be folded in...
uint64_t getMaxMemIntrinsicInlineSizeThreshold() const override
bool isLegalMaskedStore(Type *DataTy, Align Alignment, unsigned AddressSpace, TTI::MaskKind MaskKind=TTI::MaskKind::VariableOrConstantMask) const override
bool forceScalarizeMaskedScatter(VectorType *VTy, Align Alignment) const override
InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, const Value *Op0, const Value *Op1) const override
InstructionCost getArithmeticReductionCost(unsigned Opcode, VectorType *ValTy, std::optional< FastMathFlags > FMF, 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 isLegalMaskedLoad(Type *DataTy, Align Alignment, unsigned AddressSpace, TTI::MaskKind MaskKind=TTI::MaskKind::VariableOrConstantMask) const override
ARMTTIImpl(const ARMBaseTargetMachine *TM, const Function &F)
InstructionCost getIntImmCostInst(unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind, Instruction *Inst=nullptr) 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
InstructionCost getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind) const override
std::optional< Instruction * > instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const override
void getPeelingPreferences(Loop *L, ScalarEvolution &SE, TTI::PeelingPreferences &PP) const override
InstructionCost getMinMaxReductionCost(Intrinsic::ID IID, VectorType *Ty, FastMathFlags FMF, TTI::TargetCostKind CostKind) const override
TTI::AddressingModeKind getPreferredAddressingMode(const Loop *L, ScalarEvolution *SE) const override
bool preferPredicateOverEpilogue(TailFoldingInfo *TFI) const override
bool forceScalarizeMaskedGather(VectorType *VTy, Align Alignment) const override
unsigned getNumberOfRegisters(unsigned ClassID) 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
bool areInlineCompatible(const Function *Caller, const Function *Callee) const override
InstructionCost getMemIntrinsicInstrCost(const MemIntrinsicCostAttributes &MICA, TTI::TargetCostKind CostKind) const override
bool preferPredicatedReductionSelect() const override
bool isLegalMaskedGather(Type *Ty, Align Alignment) const override
unsigned getMaxInterleaveFactor(ElementCount VF) const override
unsigned getNumBytesToPadGlobalArray(unsigned Size, Type *ArrayType) const override
bool isProfitableLSRChainElement(Instruction *I) const override
bool isHardwareLoopProfitable(Loop *L, ScalarEvolution &SE, AssumptionCache &AC, TargetLibraryInfo *LibInfo, HardwareLoopInfo &HWLoopInfo) const override
void getUnrollingPreferences(Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP, OptimizationRemarkEmitter *ORE) const override
bool enableInterleavedAccessVectorization() const override
InstructionCost getScalingFactorCost(Type *Ty, GlobalValue *BaseGV, StackOffset BaseOffset, bool HasBaseReg, int64_t Scale, unsigned AddrSpace) const override
getScalingFactorCost - Return the cost of the scaling used in addressing mode represented by AM.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
Class to represent array types.
InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, const Value *Op0, const Value *Op1) const override
BasicTTIImplBase(const TargetMachine *TM, const DataLayout &DL)
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition InstrTypes.h:676
This is an important base class in LLVM.
Definition Constant.h:43
Container class for subtarget features.
The core instruction combiner logic.
A wrapper class for inspecting calls to intrinsic functions.
Represents a single loop in the control flow graph.
Definition LoopInfo.h:40
This class represents an analyzed expression in the program.
The main scalar evolution driver.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
virtual const DataLayout & getDataLayout() const
virtual InstructionCost getIntImmCost(const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind) const
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
MaskKind
Some targets only support masked load/store with a constant mask.
TargetCostKind
The kind of cost model.
AddressingModeKind
Which addressing mode Loop Strength Reduction will try to generate.
ShuffleKind
The various kinds of shuffle patterns for vector queries.
CastContextHint
Represents a hint about the context in which a cast is used.
static constexpr TypeSize getFixed(ScalarTy ExactSize)
Definition TypeSize.h:343
static constexpr TypeSize getScalable(ScalarTy MinimumSize)
Definition TypeSize.h:346
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:45
LLVM Value Representation.
Definition Value.h:75
Base class of all SIMD vector types.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
@ C
The default llvm calling convention, compatible with C.
Definition CallingConv.h:34
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Definition BasicBlock.h:73
This is an optimization pass for GlobalISel generic memory operations.
Definition Types.h:26
FunctionAddr VTableAddr Value
Definition InstrProf.h:137
ArrayRef(const T &OneElt) -> ArrayRef< T >
bool isVREVMask(ArrayRef< int > M, EVT VT, unsigned BlockSize)
isVREVMask - Check if a vector shuffle corresponds to a VREV instruction with the specified blocksize...
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39
Extended Value Type.
Definition ValueTypes.h:35
uint64_t getScalarSizeInBits() const
Definition ValueTypes.h:385
Parameters that control the generic loop unrolling transformation.