@@ -136,17 +136,6 @@ namespace {
136
136
struct CachingVPExpander {
137
137
const TargetTransformInfo &TTI;
138
138
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
-
150
139
// / \returns A bitmask that is true where the lane position is less-than \p
151
140
// / EVLParam
152
141
// /
@@ -216,17 +205,6 @@ struct CachingVPExpander {
216
205
217
206
// // CachingVPExpander {
218
207
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
-
230
208
Value *CachingVPExpander::convertEVLToMask (IRBuilder<> &Builder,
231
209
Value *EVLParam,
232
210
ElementCount ElemCount) {
@@ -245,7 +223,7 @@ Value *CachingVPExpander::convertEVLToMask(IRBuilder<> &Builder,
245
223
Type *LaneTy = EVLParam->getType ();
246
224
unsigned NumElems = ElemCount.getFixedValue ();
247
225
Value *VLSplat = Builder.CreateVectorSplat (NumElems, EVLParam);
248
- Value *IdxVec = createStepVector ( Builder, LaneTy, NumElems );
226
+ Value *IdxVec = Builder. CreateStepVector ( VectorType::get ( LaneTy, ElemCount) );
249
227
return Builder.CreateICmp (CmpInst::ICMP_ULT, IdxVec, VLSplat);
250
228
}
251
229
0 commit comments