aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ExpandVectorPredication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/ExpandVectorPredication.cpp')
-rw-r--r--llvm/lib/CodeGen/ExpandVectorPredication.cpp24
1 files changed, 1 insertions, 23 deletions
diff --git a/llvm/lib/CodeGen/ExpandVectorPredication.cpp b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
index 6f4a2c9..67df1cd 100644
--- a/llvm/lib/CodeGen/ExpandVectorPredication.cpp
+++ b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
@@ -136,17 +136,6 @@ namespace {
struct CachingVPExpander {
const TargetTransformInfo &TTI;
- /// \returns A (fixed length) vector with ascending integer indices
- /// (<0, 1, ..., NumElems-1>).
- /// \p Builder
- /// Used for instruction creation.
- /// \p LaneTy
- /// Integer element type of the result vector.
- /// \p NumElems
- /// Number of vector elements.
- Value *createStepVector(IRBuilder<> &Builder, Type *LaneTy,
- unsigned NumElems);
-
/// \returns A bitmask that is true where the lane position is less-than \p
/// EVLParam
///
@@ -216,17 +205,6 @@ public:
//// CachingVPExpander {
-Value *CachingVPExpander::createStepVector(IRBuilder<> &Builder, Type *LaneTy,
- unsigned NumElems) {
- // TODO add caching
- SmallVector<Constant *, 16> ConstElems;
-
- for (unsigned Idx = 0; Idx < NumElems; ++Idx)
- ConstElems.push_back(ConstantInt::get(LaneTy, Idx, false));
-
- return ConstantVector::get(ConstElems);
-}
-
Value *CachingVPExpander::convertEVLToMask(IRBuilder<> &Builder,
Value *EVLParam,
ElementCount ElemCount) {
@@ -245,7 +223,7 @@ Value *CachingVPExpander::convertEVLToMask(IRBuilder<> &Builder,
Type *LaneTy = EVLParam->getType();
unsigned NumElems = ElemCount.getFixedValue();
Value *VLSplat = Builder.CreateVectorSplat(NumElems, EVLParam);
- Value *IdxVec = createStepVector(Builder, LaneTy, NumElems);
+ Value *IdxVec = Builder.CreateStepVector(VectorType::get(LaneTy, ElemCount));
return Builder.CreateICmp(CmpInst::ICMP_ULT, IdxVec, VLSplat);
}