LLVM 23.0.0git
HexagonTargetTransformInfo.cpp
Go to the documentation of this file.
1//===- HexagonTargetTransformInfo.cpp - Hexagon specific TTI pass ---------===//
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/// \file
8/// This file implements a TargetTransformInfo analysis pass specific to the
9/// Hexagon target machine. It uses the target's detailed information to provide
10/// more precise answers to certain TTI queries, while letting the target
11/// independent and default TTI implementations handle the rest.
12///
13//===----------------------------------------------------------------------===//
14
16#include "HexagonSubtarget.h"
19#include "llvm/IR/InstrTypes.h"
21#include "llvm/IR/User.h"
26
27using namespace llvm;
28
29#define DEBUG_TYPE "hexagontti"
30
31static cl::opt<bool> HexagonAutoHVX("hexagon-autohvx", cl::init(false),
32 cl::Hidden, cl::desc("Enable loop vectorizer for HVX"));
33
35 "hexagon-allow-scatter-gather-hvx", cl::init(false), cl::Hidden,
36 cl::desc("Allow auto-generation of HVX scatter-gather"));
37
39 "force-hvx-float", cl::Hidden,
40 cl::desc("Enable auto-vectorization of floatint point types on v68."));
41
42static cl::opt<bool> EmitLookupTables("hexagon-emit-lookup-tables",
43 cl::init(true), cl::Hidden,
44 cl::desc("Control lookup table emission on Hexagon target"));
45
46static cl::opt<bool> HexagonMaskedVMem("hexagon-masked-vmem", cl::init(true),
47 cl::Hidden, cl::desc("Enable masked loads/stores for HVX"));
48
49// Constant "cost factor" to make floating point operations more expensive
50// in terms of vectorization cost. This isn't the best way, but it should
51// do. Ultimately, the cost should use cycles.
52static const unsigned FloatFactor = 4;
53
54bool HexagonTTIImpl::useHVX() const {
55 return ST.useHVXOps() && HexagonAutoHVX;
56}
57
58bool HexagonTTIImpl::isHVXVectorType(Type *Ty) const {
59 auto *VecTy = dyn_cast<VectorType>(Ty);
60 if (!VecTy)
61 return false;
62 if (!ST.isTypeForHVX(VecTy))
63 return false;
64 if (ST.useHVXV69Ops() || !VecTy->getElementType()->isFloatingPointTy())
65 return true;
66 return ST.useHVXV68Ops() && EnableV68FloatAutoHVX;
67}
68
69unsigned HexagonTTIImpl::getTypeNumElements(Type *Ty) const {
70 if (auto *VTy = dyn_cast<FixedVectorType>(Ty))
71 return VTy->getNumElements();
72 assert((Ty->isIntegerTy() || Ty->isFloatingPointTy()) &&
73 "Expecting scalar type");
74 return 1;
75}
76
78HexagonTTIImpl::getPopcntSupport(unsigned IntTyWidthInBit) const {
79 // Return fast hardware support as every input < 64 bits will be promoted
80 // to 64 bits.
82}
83
84// The Hexagon target can unroll loops with run-time trip counts.
90
92 TTI::PeelingPreferences &PP) const {
94 // Only try to peel innermost loops with small runtime trip counts.
95 if (L && L->isInnermost() && canPeel(L) &&
96 SE.getSmallConstantTripCount(L) == 0 &&
99 PP.PeelCount = 2;
100 }
101}
102
108
109/// --- Vector TTI begin ---
110
111unsigned HexagonTTIImpl::getNumberOfRegisters(unsigned ClassID) const {
112 bool Vector = ClassID == 1;
113 if (Vector)
114 return useHVX() ? 32 : 0;
115 return 32;
116}
117
119 return useHVX() ? 2 : 1;
120}
121
135
137 return useHVX() ? ST.getVectorLength()*8 : 32;
138}
139
141 bool IsScalable) const {
142 assert(!IsScalable && "Scalable VFs are not supported for Hexagon");
143 return ElementCount::getFixed((8 * ST.getVectorLength()) / ElemWidth);
144}
145
151
155 if (ICA.getID() == Intrinsic::bswap) {
156 std::pair<InstructionCost, MVT> LT =
158 return LT.first + 2;
159 }
161}
162
165 const SCEV *S,
167 return 0;
168}
169
171 Align Alignment,
172 unsigned AddressSpace,
175 const Instruction *I) const {
176 assert(Opcode == Instruction::Load || Opcode == Instruction::Store);
177
178 // FIXME: Load latency isn't handled here
179 if (Opcode == Instruction::Load && CostKind == TTI::TCK_Latency)
180 return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
181 CostKind, OpInfo, I);
182
183 // TODO: Handle other cost kinds.
185 return 1;
186
187 if (Opcode == Instruction::Store)
188 return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
189 CostKind, OpInfo, I);
190
191 if (Src->isVectorTy()) {
192 VectorType *VecTy = cast<VectorType>(Src);
193 unsigned VecWidth = VecTy->getPrimitiveSizeInBits().getFixedValue();
194 if (isHVXVectorType(VecTy)) {
195 unsigned RegWidth =
197 .getFixedValue();
198 assert(RegWidth && "Non-zero vector register width expected");
199 // Cost of HVX loads.
200 if (VecWidth % RegWidth == 0)
201 return VecWidth / RegWidth;
202 // Cost of constructing HVX vector from scalar loads
203 const Align RegAlign(RegWidth / 8);
204 if (Alignment > RegAlign)
205 Alignment = RegAlign;
206 unsigned AlignWidth = 8 * Alignment.value();
207 unsigned NumLoads = alignTo(VecWidth, AlignWidth) / AlignWidth;
208 return 3 * NumLoads;
209 }
210
211 // Non-HVX vectors.
212 // Add extra cost for floating point types.
213 unsigned Cost =
215
216 // At this point unspecified alignment is considered as Align(1).
217 const Align BoundAlignment = std::min(Alignment, Align(8));
218 unsigned AlignWidth = 8 * BoundAlignment.value();
219 unsigned NumLoads = alignTo(VecWidth, AlignWidth) / AlignWidth;
220 if (Alignment == Align(4) || Alignment == Align(8))
221 return Cost * NumLoads;
222 // Loads of less than 32 bits will need extra inserts to compose a vector.
223 assert(BoundAlignment <= Align(8));
224 unsigned LogA = Log2(BoundAlignment);
225 return (3 - LogA) * Cost * NumLoads;
226 }
227
228 return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace, CostKind,
229 OpInfo, I);
230}
231
234 VectorType *SrcTy, ArrayRef<int> Mask,
235 TTI::TargetCostKind CostKind, int Index,
237 const Instruction *CxtI) const {
238 return 1;
239}
240
242 unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef<unsigned> Indices,
243 Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind,
244 bool UseMaskForCond, bool UseMaskForGaps) const {
245 if (Indices.size() != Factor || UseMaskForCond || UseMaskForGaps)
246 return BaseT::getInterleavedMemoryOpCost(Opcode, VecTy, Factor, Indices,
247 Alignment, AddressSpace,
248 CostKind,
249 UseMaskForCond, UseMaskForGaps);
250 return getMemoryOpCost(Opcode, VecTy, Alignment, AddressSpace, CostKind);
251}
252
254 unsigned Opcode, Type *ValTy, Type *CondTy, CmpInst::Predicate VecPred,
256 TTI::OperandValueInfo Op2Info, const Instruction *I) const {
257 if (ValTy->isVectorTy() && CostKind == TTI::TCK_RecipThroughput) {
258 if (!isHVXVectorType(ValTy) && ValTy->isFPOrFPVectorTy())
260 std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(ValTy);
261 if (Opcode == Instruction::FCmp)
262 return LT.first + FloatFactor * getTypeNumElements(ValTy);
263 }
264 return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind,
265 Op1Info, Op2Info, I);
266}
267
269 unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
271 ArrayRef<const Value *> Args, const Instruction *CxtI) const {
272 // TODO: Handle more cost kinds.
274 return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info,
275 Op2Info, Args, CxtI);
276
277 if (Ty->isVectorTy()) {
278 if (!isHVXVectorType(Ty) && Ty->isFPOrFPVectorTy())
280 std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(Ty);
281 if (LT.second.isFloatingPoint())
282 return LT.first + FloatFactor * getTypeNumElements(Ty);
283 }
284 return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info, Op2Info,
285 Args, CxtI);
286}
287
289 Type *SrcTy,
292 const Instruction *I) const {
293 auto isNonHVXFP = [this] (Type *Ty) {
294 return Ty->isVectorTy() && !isHVXVectorType(Ty) && Ty->isFPOrFPVectorTy();
295 };
296 if (isNonHVXFP(SrcTy) || isNonHVXFP(DstTy))
298
299 if (SrcTy->isFPOrFPVectorTy() || DstTy->isFPOrFPVectorTy()) {
300 unsigned SrcN = SrcTy->isFPOrFPVectorTy() ? getTypeNumElements(SrcTy) : 0;
301 unsigned DstN = DstTy->isFPOrFPVectorTy() ? getTypeNumElements(DstTy) : 0;
302
303 std::pair<InstructionCost, MVT> SrcLT = getTypeLegalizationCost(SrcTy);
304 std::pair<InstructionCost, MVT> DstLT = getTypeLegalizationCost(DstTy);
306 std::max(SrcLT.first, DstLT.first) + FloatFactor * (SrcN + DstN);
307 // TODO: Allow non-throughput costs that aren't binary.
309 return Cost == 0 ? 0 : 1;
310 return Cost;
311 }
312 return 1;
313}
314
316 unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index,
317 const Value *Op0, const Value *Op1, TTI::VectorInstrContext VIC) const {
318 Type *ElemTy = Val->isVectorTy() ? cast<VectorType>(Val)->getElementType()
319 : Val;
320 if (Opcode == Instruction::InsertElement) {
321 // Need two rotations for non-zero index.
322 unsigned Cost = (Index != 0) ? 2 : 0;
323 if (ElemTy->isIntegerTy(32))
324 return Cost;
325 // If it's not a 32-bit value, there will need to be an extract.
326 return Cost + getVectorInstrCost(Instruction::ExtractElement, Val, CostKind,
327 Index, Op0, Op1, VIC);
328 }
329
330 if (Opcode == Instruction::ExtractElement)
331 return 2;
332
333 return 1;
334}
335
337 switch (II->getIntrinsicID()) {
338 case Intrinsic::vector_reduce_add:
339 return false;
340 }
341 return true;
342}
343
344bool HexagonTTIImpl::isLegalMaskedStore(Type *DataType, Align /*Alignment*/,
345 unsigned /*AddressSpace*/,
346 TTI::MaskKind /*MaskKind*/) const {
347 // This function is called from scalarize-masked-mem-intrin, which runs
348 // in pre-isel. Use ST directly instead of calling isHVXVectorType.
349 return HexagonMaskedVMem && ST.isTypeForHVX(DataType);
350}
351
352bool HexagonTTIImpl::isLegalMaskedLoad(Type *DataType, Align /*Alignment*/,
353 unsigned /*AddressSpace*/,
354 TTI::MaskKind /*MaskKind*/) const {
355 // This function is called from scalarize-masked-mem-intrin, which runs
356 // in pre-isel. Use ST directly instead of calling isHVXVectorType.
357 return HexagonMaskedVMem && ST.isTypeForHVX(DataType);
358}
359
361 // For now assume we can not deal with all HVX datatypes.
362 if (!Ty->isVectorTy() || !ST.isTypeForHVX(Ty) ||
364 return false;
365 // This must be in sync with HexagonVectorCombine pass.
366 switch (Ty->getScalarSizeInBits()) {
367 case 8:
368 return (getTypeNumElements(Ty) == 128);
369 case 16:
370 if (getTypeNumElements(Ty) == 64 || getTypeNumElements(Ty) == 32)
371 return (Alignment >= 2);
372 break;
373 case 32:
374 if (getTypeNumElements(Ty) == 32)
375 return (Alignment >= 4);
376 break;
377 default:
378 break;
379 }
380 return false;
381}
382
384 if (!Ty->isVectorTy() || !ST.isTypeForHVX(Ty) ||
386 return false;
387 // This must be in sync with HexagonVectorCombine pass.
388 switch (Ty->getScalarSizeInBits()) {
389 case 8:
390 return (getTypeNumElements(Ty) == 128);
391 case 16:
392 if (getTypeNumElements(Ty) == 64)
393 return (Alignment >= 2);
394 break;
395 case 32:
396 if (getTypeNumElements(Ty) == 32)
397 return (Alignment >= 4);
398 break;
399 default:
400 break;
401 }
402 return false;
403}
404
406 Align Alignment) const {
407 return !isLegalMaskedGather(VTy, Alignment);
408}
409
411 Align Alignment) const {
412 return !isLegalMaskedScatter(VTy, Alignment);
413}
414
415/// --- Vector TTI end ---
416
418 return ST.getL1PrefetchDistance();
419}
420
422 return ST.getL1CacheLineSize();
423}
424
429 auto isCastFoldedIntoLoad = [this](const CastInst *CI) -> bool {
430 if (!CI->isIntegerCast())
431 return false;
432 // Only extensions from an integer type shorter than 32-bit to i32
433 // can be folded into the load.
434 const DataLayout &DL = getDataLayout();
435 unsigned SBW = DL.getTypeSizeInBits(CI->getSrcTy());
436 unsigned DBW = DL.getTypeSizeInBits(CI->getDestTy());
437 if (DBW != 32 || SBW >= DBW)
438 return false;
439
440 const LoadInst *LI = dyn_cast<const LoadInst>(CI->getOperand(0));
441 // Technically, this code could allow multiple uses of the load, and
442 // check if all the uses are the same extension operation, but this
443 // should be sufficient for most cases.
444 return LI && LI->hasOneUse();
445 };
446
447 if (const CastInst *CI = dyn_cast<const CastInst>(U))
448 if (isCastFoldedIntoLoad(CI))
450 return BaseT::getInstructionCost(U, Operands, CostKind);
451}
452
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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")))
static const unsigned FloatFactor
static cl::opt< bool > EnableV68FloatAutoHVX("force-hvx-float", cl::Hidden, cl::desc("Enable auto-vectorization of floatint point types on v68."))
cl::opt< bool > HexagonAllowScatterGatherHVX("hexagon-allow-scatter-gather-hvx", cl::init(false), cl::Hidden, cl::desc("Allow auto-generation of HVX scatter-gather"))
static cl::opt< bool > EmitLookupTables("hexagon-emit-lookup-tables", cl::init(true), cl::Hidden, cl::desc("Control lookup table emission on Hexagon target"))
static cl::opt< bool > HexagonMaskedVMem("hexagon-masked-vmem", cl::init(true), cl::Hidden, cl::desc("Enable masked loads/stores for HVX"))
static cl::opt< bool > HexagonAutoHVX("hexagon-autohvx", cl::init(false), cl::Hidden, cl::desc("Enable loop vectorizer for HVX"))
This file implements a TargetTransformInfo analysis pass specific to the Hexagon target machine.
#define F(x, y, z)
Definition MD5.cpp:54
#define I(x, y, z)
Definition MD5.cpp:57
uint64_t IntrinsicInst * II
This pass exposes codegen information to IR-level passes.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
size_t size() const
Get the array size.
Definition ArrayRef.h:141
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 getArithmeticInstrCost(unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind, TTI::OperandValueInfo Opd1Info={TTI::OK_AnyValue, TTI::OP_None}, TTI::OperandValueInfo Opd2Info={TTI::OK_AnyValue, TTI::OP_None}, ArrayRef< const Value * > Args={}, const Instruction *CxtI=nullptr) 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 getCallInstrCost(Function *F, Type *RetTy, ArrayRef< Type * > Tys, TTI::TargetCostKind CostKind) const override
void getPeelingPreferences(Loop *L, ScalarEvolution &SE, TTI::PeelingPreferences &PP) const override
std::pair< InstructionCost, MVT > getTypeLegalizationCost(Type *Ty) const
InstructionCost getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind) 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
This is the base class for all instructions that perform data casts.
Definition InstrTypes.h:512
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition InstrTypes.h:740
A parsed version of the target data layout string in and methods for querying it.
Definition DataLayout.h:64
static constexpr ElementCount getFixed(ScalarTy MinVal)
Definition TypeSize.h:309
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
bool forceScalarizeMaskedScatter(VectorType *VTy, Align Alignment) const override
bool isLegalMaskedStore(Type *DataType, Align Alignment, unsigned AddressSpace, TTI::MaskKind MaskKind) const override
ElementCount getMinimumVF(unsigned ElemWidth, bool IsScalable) const override
bool shouldExpandReduction(const IntrinsicInst *II) const override
InstructionCost getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src, TTI::CastContextHint CCH, TTI::TargetCostKind CostKind, const Instruction *I=nullptr) const override
bool forceScalarizeMaskedGather(VectorType *VTy, Align Alignment) 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
unsigned getNumberOfRegisters(unsigned ClassID) const override
— Vector TTI begin —
InstructionCost getAddressComputationCost(Type *PtrTy, ScalarEvolution *SE, const SCEV *S, TTI::TargetCostKind CostKind) 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
TTI::PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) const override
unsigned getMinVectorRegisterBitWidth() const override
bool isLegalMaskedLoad(Type *DataType, Align Alignment, unsigned AddressSpace, TTI::MaskKind MaskKind) const override
bool isLegalMaskedGather(Type *Ty, Align Alignment) const override
TypeSize getRegisterBitWidth(TargetTransformInfo::RegisterKind K) const override
InstructionCost getCallInstrCost(Function *F, Type *RetTy, ArrayRef< Type * > Tys, TTI::TargetCostKind CostKind) const override
Compute a cost of the given call instruction.
void getPeelingPreferences(Loop *L, ScalarEvolution &SE, TTI::PeelingPreferences &PP) const override
InstructionCost getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind) const override
Get intrinsic cost based on arguments.
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
TTI::AddressingModeKind getPreferredAddressingMode(const Loop *L, ScalarEvolution *SE) const override
Bias LSR towards creating post-increment opportunities.
bool shouldBuildLookupTables() 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
unsigned getMaxInterleaveFactor(ElementCount VF) const override
bool isLegalMaskedScatter(Type *Ty, Align Alignment) 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 getInstructionCost(const User *U, ArrayRef< const Value * > Operands, TTI::TargetCostKind CostKind) const override
void getUnrollingPreferences(Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP, OptimizationRemarkEmitter *ORE) const override
unsigned getCacheLineSize() const override
unsigned getPrefetchDistance() const override
— Vector TTI end —
static InstructionCost getMax()
A wrapper class for inspecting calls to intrinsic functions.
An instruction for reading from memory.
Represents a single loop in the control flow graph.
Definition LoopInfo.h:40
The optimization diagnostic interface.
This class represents an analyzed expression in the program.
The main scalar evolution driver.
LLVM_ABI unsigned getSmallConstantMaxTripCount(const Loop *L, SmallVectorImpl< const SCEVPredicate * > *Predicates=nullptr)
Returns the upper bound of the loop trip count as a normal unsigned value.
LLVM_ABI unsigned getSmallConstantTripCount(const Loop *L)
Returns the exact trip count of the loop if we can compute it, and the result is a small constant.
virtual const DataLayout & getDataLayout() const
virtual InstructionCost getInstructionCost(const User *U, ArrayRef< const Value * > Operands, TTI::TargetCostKind CostKind) const
VectorInstrContext
Represents a hint about the context in which an insert/extract is used.
MaskKind
Some targets only support masked load/store with a constant mask.
TargetCostKind
The kind of cost model.
@ TCK_RecipThroughput
Reciprocal throughput.
@ TCK_Latency
The latency of instruction.
PopcntSupportKind
Flags indicating the kind of support for population count.
@ TCC_Free
Expected to fold away in lowering.
AddressingModeKind
Which addressing mode Loop Strength Reduction will try to generate.
@ AMK_PostIndexed
Prefer post-indexed addressing mode.
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:46
bool isVectorTy() const
True if this is an instance of VectorType.
Definition Type.h:290
LLVM_ABI TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
Definition Type.cpp:201
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
Definition Type.h:186
bool isIntegerTy() const
True if this is an instance of IntegerType.
Definition Type.h:257
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
Definition Type.h:227
LLVM Value Representation.
Definition Value.h:75
bool hasOneUse() const
Return true if there is exactly one use of this value.
Definition Value.h:439
Base class of all SIMD vector types.
Type * getElementType() const
constexpr ScalarTy getFixedValue() const
Definition TypeSize.h:200
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
InstructionCost Cost
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
bool canPeel(const Loop *L)
Definition LoopPeel.cpp:97
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition Alignment.h:144
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:559
unsigned Log2(Align A)
Returns the log2 of the alignment.
Definition Alignment.h:197
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39
constexpr uint64_t value() const
This is a hole in the type system and should not be abused.
Definition Alignment.h:77
unsigned PeelCount
A forced peeling factor (the number of bodied of the original loop that should be peeled off before t...
Parameters that control the generic loop unrolling transformation.
bool Runtime
Allow runtime unrolling (unrolling of loops to expand the size of the loop body even when the number ...
bool Partial
Allow partial unrolling (unrolling of loops to expand the size of the loop body, not only to eliminat...