LLVM  12.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"
20 #include "llvm/IR/Instructions.h"
21 #include "llvm/IR/User.h"
22 #include "llvm/Support/Casting.h"
25 
26 using namespace llvm;
27 
28 #define DEBUG_TYPE "hexagontti"
29 
30 static cl::opt<bool> HexagonAutoHVX("hexagon-autohvx", cl::init(false),
31  cl::Hidden, cl::desc("Enable loop vectorizer for HVX"));
32 
33 static cl::opt<bool> EmitLookupTables("hexagon-emit-lookup-tables",
34  cl::init(true), cl::Hidden,
35  cl::desc("Control lookup table emission on Hexagon target"));
36 
37 // Constant "cost factor" to make floating point operations more expensive
38 // in terms of vectorization cost. This isn't the best way, but it should
39 // do. Ultimately, the cost should use cycles.
40 static const unsigned FloatFactor = 4;
41 
42 bool HexagonTTIImpl::useHVX() const {
43  return ST.useHVXOps() && HexagonAutoHVX;
44 }
45 
46 bool HexagonTTIImpl::isTypeForHVX(Type *VecTy) const {
47  assert(VecTy->isVectorTy());
48  if (isa<ScalableVectorType>(VecTy))
49  return false;
50  // Avoid types like <2 x i32*>.
51  if (!cast<VectorType>(VecTy)->getElementType()->isIntegerTy())
52  return false;
53  EVT VecVT = EVT::getEVT(VecTy);
54  if (!VecVT.isSimple() || VecVT.getSizeInBits() <= 64)
55  return false;
56  if (ST.isHVXVectorType(VecVT.getSimpleVT()))
57  return true;
58  auto Action = TLI.getPreferredVectorAction(VecVT.getSimpleVT());
59  return Action == TargetLoweringBase::TypeWidenVector;
60 }
61 
62 unsigned HexagonTTIImpl::getTypeNumElements(Type *Ty) const {
63  if (auto *VTy = dyn_cast<FixedVectorType>(Ty))
64  return VTy->getNumElements();
65  assert((Ty->isIntegerTy() || Ty->isFloatingPointTy()) &&
66  "Expecting scalar type");
67  return 1;
68 }
69 
71 HexagonTTIImpl::getPopcntSupport(unsigned IntTyWidthInBit) const {
72  // Return fast hardware support as every input < 64 bits will be promoted
73  // to 64 bits.
75 }
76 
77 // The Hexagon target can unroll loops with run-time trip counts.
80  UP.Runtime = UP.Partial = true;
81 }
82 
86  // Only try to peel innermost loops with small runtime trip counts.
87  if (L && L->empty() && canPeel(L) &&
88  SE.getSmallConstantTripCount(L) == 0 &&
89  SE.getSmallConstantMaxTripCount(L) > 0 &&
90  SE.getSmallConstantMaxTripCount(L) <= 5) {
91  PP.PeelCount = 2;
92  }
93 }
94 
96  return true;
97 }
98 
99 /// --- Vector TTI begin ---
100 
102  if (Vector)
103  return useHVX() ? 32 : 0;
104  return 32;
105 }
106 
108  return useHVX() ? 2 : 0;
109 }
110 
112  return Vector ? getMinVectorRegisterBitWidth() : 32;
113 }
114 
116  return useHVX() ? ST.getVectorLength()*8 : 0;
117 }
118 
119 unsigned HexagonTTIImpl::getMinimumVF(unsigned ElemWidth) const {
120  return (8 * ST.getVectorLength()) / ElemWidth;
121 }
122 
124  const APInt &DemandedElts,
125  bool Insert, bool Extract) {
126  return BaseT::getScalarizationOverhead(Ty, DemandedElts, Insert, Extract);
127 }
128 
130  ArrayRef<const Value*> Args, unsigned VF) {
132 }
133 
136  return BaseT::getCallInstrCost(F, RetTy, Tys, CostKind);
137 }
138 
139 unsigned
142  if (ICA.getID() == Intrinsic::bswap) {
143  std::pair<int, MVT> LT = TLI.getTypeLegalizationCost(DL, ICA.getReturnType());
144  return LT.first + 2;
145  }
146  return BaseT::getIntrinsicInstrCost(ICA, CostKind);
147 }
148 
150  ScalarEvolution *SE, const SCEV *S) {
151  return 0;
152 }
153 
154 unsigned HexagonTTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
155  MaybeAlign Alignment,
156  unsigned AddressSpace,
158  const Instruction *I) {
159  assert(Opcode == Instruction::Load || Opcode == Instruction::Store);
160  // TODO: Handle other cost kinds.
161  if (CostKind != TTI::TCK_RecipThroughput)
162  return 1;
163 
164  if (Opcode == Instruction::Store)
165  return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
166  CostKind, I);
167 
168  if (Src->isVectorTy()) {
169  VectorType *VecTy = cast<VectorType>(Src);
170  unsigned VecWidth = VecTy->getPrimitiveSizeInBits().getFixedSize();
171  if (useHVX() && isTypeForHVX(VecTy)) {
172  unsigned RegWidth = getRegisterBitWidth(true);
173  assert(RegWidth && "Non-zero vector register width expected");
174  // Cost of HVX loads.
175  if (VecWidth % RegWidth == 0)
176  return VecWidth / RegWidth;
177  // Cost of constructing HVX vector from scalar loads
178  const Align RegAlign(RegWidth / 8);
179  if (!Alignment || *Alignment > RegAlign)
180  Alignment = RegAlign;
181  assert(Alignment);
182  unsigned AlignWidth = 8 * Alignment->value();
183  unsigned NumLoads = alignTo(VecWidth, AlignWidth) / AlignWidth;
184  return 3 * NumLoads;
185  }
186 
187  // Non-HVX vectors.
188  // Add extra cost for floating point types.
189  unsigned Cost =
190  VecTy->getElementType()->isFloatingPointTy() ? FloatFactor : 1;
191 
192  // At this point unspecified alignment is considered as Align(1).
193  const Align BoundAlignment = std::min(Alignment.valueOrOne(), Align(8));
194  unsigned AlignWidth = 8 * BoundAlignment.value();
195  unsigned NumLoads = alignTo(VecWidth, AlignWidth) / AlignWidth;
196  if (Alignment == Align(4) || Alignment == Align(8))
197  return Cost * NumLoads;
198  // Loads of less than 32 bits will need extra inserts to compose a vector.
199  assert(BoundAlignment <= Align(8));
200  unsigned LogA = Log2(BoundAlignment);
201  return (3 - LogA) * Cost * NumLoads;
202  }
203 
204  return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
205  CostKind, I);
206 }
207 
208 unsigned HexagonTTIImpl::getMaskedMemoryOpCost(unsigned Opcode, Type *Src,
209  Align Alignment,
210  unsigned AddressSpace,
212  return BaseT::getMaskedMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
213  CostKind);
214 }
215 
217  int Index, Type *SubTp) {
218  return 1;
219 }
220 
222  unsigned Opcode, Type *DataTy, const Value *Ptr, bool VariableMask,
223  Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I) {
224  return BaseT::getGatherScatterOpCost(Opcode, DataTy, Ptr, VariableMask,
225  Alignment, CostKind, I);
226 }
227 
229  unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef<unsigned> Indices,
230  Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind,
231  bool UseMaskForCond, bool UseMaskForGaps) {
232  if (Indices.size() != Factor || UseMaskForCond || UseMaskForGaps)
233  return BaseT::getInterleavedMemoryOpCost(Opcode, VecTy, Factor, Indices,
234  Alignment, AddressSpace,
235  CostKind,
236  UseMaskForCond, UseMaskForGaps);
237  return getMemoryOpCost(Opcode, VecTy, MaybeAlign(Alignment), AddressSpace,
238  CostKind);
239 }
240 
241 unsigned HexagonTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
242  Type *CondTy, TTI::TargetCostKind CostKind, const Instruction *I) {
243  if (ValTy->isVectorTy() && CostKind == TTI::TCK_RecipThroughput) {
244  std::pair<int, MVT> LT = TLI.getTypeLegalizationCost(DL, ValTy);
245  if (Opcode == Instruction::FCmp)
246  return LT.first + FloatFactor * getTypeNumElements(ValTy);
247  }
248  return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
249 }
250 
252  unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
253  TTI::OperandValueKind Opd1Info,
254  TTI::OperandValueKind Opd2Info, TTI::OperandValueProperties Opd1PropInfo,
256  const Instruction *CxtI) {
257  // TODO: Handle more cost kinds.
258  if (CostKind != TTI::TCK_RecipThroughput)
259  return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Opd1Info,
260  Opd2Info, Opd1PropInfo,
261  Opd2PropInfo, Args, CxtI);
262 
263  if (Ty->isVectorTy()) {
264  std::pair<int, MVT> LT = TLI.getTypeLegalizationCost(DL, Ty);
265  if (LT.second.isFloatingPoint())
266  return LT.first + FloatFactor * getTypeNumElements(Ty);
267  }
268  return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Opd1Info, Opd2Info,
269  Opd1PropInfo, Opd2PropInfo, Args, CxtI);
270 }
271 
272 unsigned HexagonTTIImpl::getCastInstrCost(unsigned Opcode, Type *DstTy,
273  Type *SrcTy, TTI::TargetCostKind CostKind, const Instruction *I) {
274  if (SrcTy->isFPOrFPVectorTy() || DstTy->isFPOrFPVectorTy()) {
275  unsigned SrcN = SrcTy->isFPOrFPVectorTy() ? getTypeNumElements(SrcTy) : 0;
276  unsigned DstN = DstTy->isFPOrFPVectorTy() ? getTypeNumElements(DstTy) : 0;
277 
278  std::pair<int, MVT> SrcLT = TLI.getTypeLegalizationCost(DL, SrcTy);
279  std::pair<int, MVT> DstLT = TLI.getTypeLegalizationCost(DL, DstTy);
280  unsigned Cost = std::max(SrcLT.first, DstLT.first) + FloatFactor * (SrcN + DstN);
281  // TODO: Allow non-throughput costs that aren't binary.
282  if (CostKind != TTI::TCK_RecipThroughput)
283  return Cost == 0 ? 0 : 1;
284  return Cost;
285  }
286  return 1;
287 }
288 
289 unsigned HexagonTTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val,
290  unsigned Index) {
291  Type *ElemTy = Val->isVectorTy() ? cast<VectorType>(Val)->getElementType()
292  : Val;
293  if (Opcode == Instruction::InsertElement) {
294  // Need two rotations for non-zero index.
295  unsigned Cost = (Index != 0) ? 2 : 0;
296  if (ElemTy->isIntegerTy(32))
297  return Cost;
298  // If it's not a 32-bit value, there will need to be an extract.
299  return Cost + getVectorInstrCost(Instruction::ExtractElement, Val, Index);
300  }
301 
302  if (Opcode == Instruction::ExtractElement)
303  return 2;
304 
305  return 1;
306 }
307 
308 /// --- Vector TTI end ---
309 
311  return ST.getL1PrefetchDistance();
312 }
313 
315  return ST.getL1CacheLineSize();
316 }
317 
318 int
322  auto isCastFoldedIntoLoad = [this](const CastInst *CI) -> bool {
323  if (!CI->isIntegerCast())
324  return false;
325  // Only extensions from an integer type shorter than 32-bit to i32
326  // can be folded into the load.
327  const DataLayout &DL = getDataLayout();
328  unsigned SBW = DL.getTypeSizeInBits(CI->getSrcTy());
329  unsigned DBW = DL.getTypeSizeInBits(CI->getDestTy());
330  if (DBW != 32 || SBW >= DBW)
331  return false;
332 
333  const LoadInst *LI = dyn_cast<const LoadInst>(CI->getOperand(0));
334  // Technically, this code could allow multiple uses of the load, and
335  // check if all the uses are the same extension operation, but this
336  // should be sufficient for most cases.
337  return LI && LI->hasOneUse();
338  };
339 
340  if (const CastInst *CI = dyn_cast<const CastInst>(U))
341  if (isCastFoldedIntoLoad(CI))
343  return BaseT::getUserCost(U, Operands, CostKind);
344 }
345 
347  return EmitLookupTables;
348 }
unsigned getScalarizationOverhead(VectorType *Ty, const APInt &DemandedElts, bool Insert, bool Extract)
unsigned Log2(Align A)
Returns the log2 of the alignment.
Definition: Alignment.h:217
unsigned getOperandsScalarizationOverhead(ArrayRef< const Value *> Args, unsigned VF)
unsigned getSmallConstantTripCount(const Loop *L)
Returns the maximum trip count of the loop if it is a single-exit loop and we can compute a small max...
A parsed version of the target data layout string in and methods for querying it. ...
Definition: DataLayout.h:111
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
bool Partial
Allow partial unrolling (unrolling of loops to expand the size of the loop body, not only to eliminat...
Align valueOrOne() const
For convenience, returns a valid alignment or 1 if undefined.
Definition: Alignment.h:144
LLVM_NODISCARD std::enable_if_t< !is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > dyn_cast(const Y &Val)
Definition: Casting.h:334
unsigned getMinimumVF(unsigned ElemWidth) const
This class represents lattice values for constants.
Definition: AllocatorList.h:23
int getUserCost(const User *U, ArrayRef< const Value *> Operands, TTI::TargetCostKind CostKind)
void getPeelingPreferences(Loop *L, ScalarEvolution &SE, TTI::PeelingPreferences &PP)
Definition: BasicTTIImpl.h:454
The main scalar evolution driver.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
Definition: ValueTypes.h:260
F(f)
An instruction for reading from memory.
Definition: Instructions.h:173
TypeSize getTypeSizeInBits(Type *Ty) const
Size examples:
Definition: DataLayout.h:652
bool isVectorTy() const
True if this is an instance of VectorType.
Definition: Type.h:231
unsigned getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind)
Get intrinsic cost based on arguments.
unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src, TTI::TargetCostKind CostKind, const Instruction *I=nullptr)
unsigned getL1CacheLineSize() const
unsigned getMemoryOpCost(unsigned Opcode, Type *Src, MaybeAlign Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, const Instruction *I=nullptr)
unsigned getSmallConstantMaxTripCount(const Loop *L)
Returns the upper bound of the loop trip count as a normal unsigned value.
static cl::opt< TargetTransformInfo::TargetCostKind > CostKind("cost-kind", cl::desc("Target cost kind"), cl::init(TargetTransformInfo::TCK_RecipThroughput), cl::values(clEnumValN(TargetTransformInfo::TCK_RecipThroughput, "throughput", "Reciprocal throughput"), clEnumValN(TargetTransformInfo::TCK_Latency, "latency", "Instruction latency"), clEnumValN(TargetTransformInfo::TCK_CodeSize, "code-size", "Code size")))
unsigned getOperandsScalarizationOverhead(ArrayRef< const Value * > Args, unsigned VF)
Estimate the overhead of scalarizing an instructions unique non-constant operands.
Definition: BasicTTIImpl.h:573
This is the base class for all instructions that perform data casts.
Definition: InstrTypes.h:432
bool isFloatingPointTy() const
Return true if this is one of the six floating-point types.
Definition: Type.h:162
bool isIntegerTy() const
True if this is an instance of IntegerType.
Definition: Type.h:198
mir Rename Register Operands
unsigned getMaskedMemoryOpCost(unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind=TTI::TCK_SizeAndLatency)
unsigned getL1PrefetchDistance() const
PopcntSupportKind
Flags indicating the kind of support for population count.
unsigned getMinVectorRegisterBitWidth() const
TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const override
Return the preferred vector type legalization action.
unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind=TTI::TCK_RecipThroughput, TTI::OperandValueKind Opd1Info=TTI::OK_AnyValue, TTI::OperandValueKind Opd2Info=TTI::OK_AnyValue, TTI::OperandValueProperties Opd1PropInfo=TTI::OP_None, TTI::OperandValueProperties Opd2PropInfo=TTI::OP_None, ArrayRef< const Value *> Args=ArrayRef< const Value *>(), const Instruction *CxtI=nullptr)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
unsigned getAddressComputationCost(Type *Tp, ScalarEvolution *SE, const SCEV *S)
unsigned getGatherScatterOpCost(unsigned Opcode, Type *DataTy, const Value *Ptr, bool VariableMask, Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I=nullptr)
uint64_t value() const
This is a hole in the type system and should not be abused.
Definition: Alignment.h:85
This file implements a TargetTransformInfo analysis pass specific to the Hexagon target machine...
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:434
unsigned getCallInstrCost(Function *F, Type *RetTy, ArrayRef< Type * > Tys, TTI::TargetCostKind CostKind=TTI::TCK_SizeAndLatency)
Compute a cost of the given call instruction.
TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
Definition: Type.cpp:113
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:156
uint64_t getFixedSize() const
Definition: TypeSize.h:137
Type * getElementType() const
Definition: DerivedTypes.h:442
Expected to fold away in lowering.
void getPeelingPreferences(Loop *L, ScalarEvolution &SE, TTI::PeelingPreferences &PP)
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
Definition: FileCheck.cpp:305
unsigned getRegisterBitWidth(bool Vector) const
unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp)
Extended Value Type.
Definition: ValueTypes.h:35
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
Definition: ValueTypes.h:315
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
unsigned getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, bool UseMaskForCond=false, bool UseMaskForGaps=false)
Definition: BasicTTIImpl.h:949
OperandValueProperties
Additional properties of an operand&#39;s values.
unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index)
bool shouldFavorPostInc() const
Bias LSR towards creating post-increment opportunities.
unsigned getScalarizationOverhead(VectorType *InTy, const APInt &DemandedElts, bool Insert, bool Extract)
Estimate the overhead of scalarizing an instruction.
Definition: BasicTTIImpl.h:538
bool isHVXVectorType(MVT VecTy, bool IncludeBool=false) const
Align max(MaybeAlign Lhs, Align Rhs)
Definition: Alignment.h:350
unsigned getMemoryOpCost(unsigned Opcode, Type *Src, MaybeAlign Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, const Instruction *I=nullptr)
Definition: BasicTTIImpl.h:910
This struct is a compact representation of a valid (power of two) or undefined (0) alignment...
Definition: Alignment.h:119
AddressSpace
Definition: NVPTXBaseInfo.h:21
static cl::opt< bool > HexagonAutoHVX("hexagon-autohvx", cl::init(false), cl::Hidden, cl::desc("Enable loop vectorizer for HVX"))
bool canPeel(Loop *L)
bool Runtime
Allow runtime unrolling (unrolling of loops to expand the size of the loop body even when the number ...
Base class of all SIMD vector types.
Definition: DerivedTypes.h:390
Class for arbitrary precision integers.
Definition: APInt.h:69
int getUserCost(const User *U, ArrayRef< const Value * > Operands, TTI::TargetCostKind CostKind)
unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy, TTI::TargetCostKind CostKind, const Instruction *I=nullptr)
Definition: BasicTTIImpl.h:858
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition: Alignment.h:158
unsigned getVectorLength() const
This class represents an analyzed expression in the program.
unsigned getNumberOfRegisters(bool vector) const
— Vector TTI begin —
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:516
unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy, TTI::TargetCostKind CostKind, const Instruction *I=nullptr)
Parameters that control the generic loop unrolling transformation.
static cl::opt< bool > EmitLookupTables("hexagon-emit-lookup-tables", cl::init(true), cl::Hidden, cl::desc("Control lookup table emission on Hexagon target"))
unsigned getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind)
#define I(x, y, z)
Definition: MD5.cpp:59
unsigned getMaxInterleaveFactor(unsigned VF)
unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind=TTI::TCK_RecipThroughput, TTI::OperandValueKind Opd1Info=TTI::OK_AnyValue, TTI::OperandValueKind Opd2Info=TTI::OK_AnyValue, TTI::OperandValueProperties Opd1PropInfo=TTI::OP_None, TTI::OperandValueProperties Opd2PropInfo=TTI::OP_None, ArrayRef< const Value * > Args=ArrayRef< const Value * >(), const Instruction *CxtI=nullptr)
Definition: BasicTTIImpl.h:615
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
Definition: ValueTypes.cpp:507
unsigned PeelCount
A forced peeling factor (the number of bodied of the original loop that should be peeled off before t...
bool empty() const
Definition: LoopInfo.h:158
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
Definition: Type.h:186
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Definition: Value.h:74
unsigned getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind=TTI::TCK_SizeAndLatency, bool UseMaskForCond=false, bool UseMaskForGaps=false)
unsigned getGatherScatterOpCost(unsigned Opcode, Type *DataTy, const Value *Ptr, bool VariableMask, Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I)
void getUnrollingPreferences(Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP)
unsigned getCacheLineSize() const override
unsigned getCallInstrCost(Function *F, Type *RetTy, ArrayRef< Type *> Tys, TTI::TargetCostKind CostKind)
const DataLayout & getDataLayout() const
bool hasOneUse() const
Return true if there is exactly one user of this value.
Definition: Value.h:431
OperandValueKind
Additional information about an operand&#39;s possible values.
TTI::PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) const
This pass exposes codegen information to IR-level passes.
TargetCostKind
The kind of cost model.
unsigned getMaskedMemoryOpCost(unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind)
static const unsigned FloatFactor
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
Definition: ValueTypes.h:131
unsigned getPrefetchDistance() const override
— Vector TTI end —
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
std::pair< int, MVT > getTypeLegalizationCost(const DataLayout &DL, Type *Ty) const
Estimate the cost of type-legalization and the legalized type.
ShuffleKind
The various kinds of shuffle patterns for vector queries.