Skip to content

Commit ef77188

Browse files
authored
[VP] Remove createStepVector implementation and use IRBuilderBase::CreateStepVector instead. NFC (#122868)
1 parent f79bacb commit ef77188

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

llvm/lib/CodeGen/ExpandVectorPredication.cpp

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,6 @@ namespace {
136136
struct CachingVPExpander {
137137
const TargetTransformInfo &TTI;
138138

139-
/// \returns A (fixed length) vector with ascending integer indices
140-
/// (<0, 1, ..., NumElems-1>).
141-
/// \p Builder
142-
/// Used for instruction creation.
143-
/// \p LaneTy
144-
/// Integer element type of the result vector.
145-
/// \p NumElems
146-
/// Number of vector elements.
147-
Value *createStepVector(IRBuilder<> &Builder, Type *LaneTy,
148-
unsigned NumElems);
149-
150139
/// \returns A bitmask that is true where the lane position is less-than \p
151140
/// EVLParam
152141
///
@@ -216,17 +205,6 @@ struct CachingVPExpander {
216205

217206
//// CachingVPExpander {
218207

219-
Value *CachingVPExpander::createStepVector(IRBuilder<> &Builder, Type *LaneTy,
220-
unsigned NumElems) {
221-
// TODO add caching
222-
SmallVector<Constant *, 16> ConstElems;
223-
224-
for (unsigned Idx = 0; Idx < NumElems; ++Idx)
225-
ConstElems.push_back(ConstantInt::get(LaneTy, Idx, false));
226-
227-
return ConstantVector::get(ConstElems);
228-
}
229-
230208
Value *CachingVPExpander::convertEVLToMask(IRBuilder<> &Builder,
231209
Value *EVLParam,
232210
ElementCount ElemCount) {
@@ -245,7 +223,7 @@ Value *CachingVPExpander::convertEVLToMask(IRBuilder<> &Builder,
245223
Type *LaneTy = EVLParam->getType();
246224
unsigned NumElems = ElemCount.getFixedValue();
247225
Value *VLSplat = Builder.CreateVectorSplat(NumElems, EVLParam);
248-
Value *IdxVec = createStepVector(Builder, LaneTy, NumElems);
226+
Value *IdxVec = Builder.CreateStepVector(VectorType::get(LaneTy, ElemCount));
249227
return Builder.CreateICmp(CmpInst::ICMP_ULT, IdxVec, VLSplat);
250228
}
251229

0 commit comments

Comments
 (0)