From 92aae9e7258acc54c9c02fe5c5d9e08175bd275a Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Thu, 6 Apr 2023 08:11:48 -0700 Subject: [PATCH] [LV] Remove a cover function with a single use [nfc] And more importantly, move the fixme to the sole caller where it actually makes sense in context. --- .../llvm/Transforms/Vectorize/LoopVectorizationLegality.h | 10 ---------- llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp | 6 +++++- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h b/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h index 45d786e..4514e60 100644 --- a/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h +++ b/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h @@ -463,16 +463,6 @@ private: void addInductionPhi(PHINode *Phi, const InductionDescriptor &ID, SmallPtrSetImpl &AllowedExit); - /// If an access has a symbolic strides, this maps the pointer value to - /// the stride symbol. - const ValueToValueMap *getSymbolicStrides() const { - // FIXME: Currently, the set of symbolic strides is sometimes queried before - // it's collected. This happens from canVectorizeWithIfConvert, when the - // pointer is checked to reference consecutive elements suitable for a - // masked access. - return LAI ? &LAI->getSymbolicStrides() : nullptr; - } - /// The loop that we evaluate. Loop *TheLoop; diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp index 64290f0..f45d800 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp @@ -452,8 +452,12 @@ static bool storeToSameAddress(ScalarEvolution *SE, StoreInst *A, int LoopVectorizationLegality::isConsecutivePtr(Type *AccessTy, Value *Ptr) const { + // FIXME: Currently, the set of symbolic strides is sometimes queried before + // it's collected. This happens from canVectorizeWithIfConvert, when the + // pointer is checked to reference consecutive elements suitable for a + // masked access. const ValueToValueMap &Strides = - getSymbolicStrides() ? *getSymbolicStrides() : ValueToValueMap(); + LAI ? LAI->getSymbolicStrides() : ValueToValueMap(); Function *F = TheLoop->getHeader()->getParent(); bool OptForSize = F->hasOptSize() || -- 2.7.4