Skip to content

Commit f751d62

Browse files
committed
Change shouldSplitVectorElementType to better match the description.
Pass the entire vector type, and not just the element. llvm-svn: 205247
1 parent ce5ac7d commit f751d62

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

llvm/include/llvm/Target/TargetLowering.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class TargetLoweringBase {
183183
/// Return true if a vector of the given type should be split
184184
/// (TypeSplitVector) instead of promoted (TypePromoteInteger) during type
185185
/// legalization.
186-
virtual bool shouldSplitVectorElementType(EVT /*VT*/) const { return false; }
186+
virtual bool shouldSplitVectorType(EVT /*VT*/) const { return false; }
187187

188188
// There are two general methods for expanding a BUILD_VECTOR node:
189189
// 1. Use SCALAR_TO_VECTOR on the defined scalar values and then shuffle

llvm/lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ void TargetLoweringBase::computeRegisterProperties() {
10871087
// that wider vector type.
10881088
MVT EltVT = VT.getVectorElementType();
10891089
unsigned NElts = VT.getVectorNumElements();
1090-
if (NElts != 1 && !shouldSplitVectorElementType(EltVT)) {
1090+
if (NElts != 1 && !shouldSplitVectorType(VT)) {
10911091
bool IsLegalWiderType = false;
10921092
// First try to promote the elements of integer vectors. If no legal
10931093
// promotion was found, fallback to the widen-vector method.

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ const char *NVPTXTargetLowering::getTargetNodeName(unsigned Opcode) const {
331331
}
332332
}
333333

334-
bool NVPTXTargetLowering::shouldSplitVectorElementType(EVT VT) const {
335-
return VT == MVT::i1;
334+
bool NVPTXTargetLowering::shouldSplitVectorType(EVT VT) const {
335+
return VT.getScalarType() == MVT::i1;
336336
}
337337

338338
SDValue

llvm/lib/Target/NVPTX/NVPTXISelLowering.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class NVPTXTargetLowering : public TargetLowering {
141141
// PTX always uses 32-bit shift amounts
142142
virtual MVT getScalarShiftAmountTy(EVT LHSTy) const { return MVT::i32; }
143143

144-
virtual bool shouldSplitVectorElementType(EVT VT) const;
144+
virtual bool shouldSplitVectorType(EVT VT) const override;
145145

146146
private:
147147
const NVPTXSubtarget &nvptxSubtarget; // cache the subtarget here

llvm/lib/Target/R600/SIISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ bool SITargetLowering::allowsUnalignedMemoryAccesses(EVT VT,
211211
return VT.bitsGT(MVT::i32);
212212
}
213213

214-
bool SITargetLowering::shouldSplitVectorElementType(EVT VT) const {
215-
return VT.bitsLE(MVT::i16);
214+
bool SITargetLowering::shouldSplitVectorType(EVT VT) const {
215+
return VT.getScalarType().bitsLE(MVT::i16);
216216
}
217217

218218
bool SITargetLowering::shouldConvertConstantLoadToIntImm(const APInt &Imm,

llvm/lib/Target/R600/SIISelLowering.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class SITargetLowering : public AMDGPUTargetLowering {
5050
public:
5151
SITargetLowering(TargetMachine &tm);
5252
bool allowsUnalignedMemoryAccesses(EVT VT, unsigned AS, bool *IsFast) const;
53-
virtual bool shouldSplitVectorElementType(EVT VT) const;
53+
virtual bool shouldSplitVectorType(EVT VT) const override;
5454

5555
virtual bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
5656
Type *Ty) const override;

0 commit comments

Comments
 (0)