LLVM: lib/Target/VE/VETargetTransformInfo.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef LLVM_LIB_TARGET_VE_VETARGETTRANSFORMINFO_H
17#define LLVM_LIB_TARGET_VE_VETARGETTRANSFORMINFO_H
18
19#include "VE.h"
23
27
29 using namespace llvm;
31 return Ty;
33}
34
36
37 if (ElemTy.isIntegerTy()) {
38 unsigned ScaBits = ElemTy.getScalarSizeInBits();
39 return ScaBits == 1 || ScaBits == 32 || ScaBits == 64;
40 }
41 if (ElemTy.isPointerTy()) {
42 return true;
43 }
44 if (ElemTy.isFloatTy() || ElemTy.isDoubleTy()) {
45 return true;
46 }
47 return false;
48}
49
50namespace llvm {
51
54 friend BaseT;
55
58
59 const VESubtarget *getST() const { return ST; }
61
62 bool enableVPU() const { return getST()->enableVPU(); }
63
64 static bool isSupportedReduction(Intrinsic::ID ReductionID) {
65#define VEC_VP_CASE(SUFFIX) \
66 case Intrinsic::vp_reduce_##SUFFIX: \
67 case Intrinsic::vector_reduce_##SUFFIX:
68
69 switch (ReductionID) {
75 return true;
76
77 default:
78 return false;
79 }
80#undef VEC_VP_CASE
81 }
82
83public:
85 : BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)),
86 TLI(ST->getTargetLowering()) {}
87
89 bool VectorRegs = (ClassID == 1);
90 if (VectorRegs) {
91
92 return 0;
93 }
94
95 return 64;
96 }
97
100 switch (K) {
104
108 }
109
111 }
112
113
114
120
125
127
128
129
130
131
132
133 return false;
134 }
135
136
137 bool
143 Type *DataType, Align Alignment, unsigned ,
146 }
153
154
156 if (!enableVPU())
157 return true;
158 return !isSupportedReduction(II->getIntrinsicID());
159 }
160};
161
162}
163
164#endif
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
TargetTransformInfo::VPLegalization VPLegalization
uint64_t IntrinsicInst * II
This pass exposes codegen information to IR-level passes.
static llvm::Type * getLaneType(llvm::Type *Ty)
Definition VETargetTransformInfo.h:28
static bool isVectorLaneType(llvm::Type &ElemTy)
Definition VETargetTransformInfo.h:35
#define VEC_VP_CASE(SUFFIX)
static llvm::Type * getVectorElementType(llvm::Type *Ty)
Definition VETargetTransformInfo.h:24
BasicTTIImplBase(const TargetMachine *TM, const DataLayout &DL)
A wrapper class for inspecting calls to intrinsic functions.
virtual const DataLayout & getDataLayout() const
MaskKind
Some targets only support masked load/store with a constant mask.
static constexpr TypeSize getFixed(ScalarTy ExactSize)
static constexpr TypeSize getScalable(ScalarTy MinimumSize)
The instances of the Type class are immutable: once they are created, they are never changed.
bool isLegalMaskedGather(Type *DataType, Align Alignment) const override
Definition VETargetTransformInfo.h:147
bool isLegalMaskedStore(Type *DataType, Align Alignment, unsigned, TargetTransformInfo::MaskKind) const override
Definition VETargetTransformInfo.h:142
VETTIImpl(const VETargetMachine *TM, const Function &F)
Definition VETargetTransformInfo.h:84
bool shouldBuildRelLookupTables() const override
Definition VETargetTransformInfo.h:126
bool shouldExpandReduction(const IntrinsicInst *II) const override
Definition VETargetTransformInfo.h:155
bool isLegalMaskedLoad(Type *DataType, Align Alignment, unsigned, TargetTransformInfo::MaskKind) const override
Definition VETargetTransformInfo.h:138
unsigned getNumberOfRegisters(unsigned ClassID) const override
Definition VETargetTransformInfo.h:88
TypeSize getRegisterBitWidth(TargetTransformInfo::RegisterKind K) const override
Definition VETargetTransformInfo.h:99
bool isLegalMaskedScatter(Type *DataType, Align Alignment) const override
Definition VETargetTransformInfo.h:150
TargetTransformInfo::VPLegalization getVPLegalizationStrategy(const VPIntrinsic &PI) const override
Definition VETargetTransformInfo.h:116
unsigned getMinVectorRegisterBitWidth() const override
Definition VETargetTransformInfo.h:121
This is the common base class for vector predication intrinsics.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
bool isa(const From &Val)
isa - Return true if the parameter to the template is an instance of one of the template type argu...
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
This struct is a compact representation of a valid (non-zero power of two) alignment.