diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 05b5764ffcafc..26df5fff59568 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2566,9 +2566,9 @@ static Value *getExpandedStep(const InductionDescriptor &ID, return C->getValue(); if (auto *U = dyn_cast(Step)) return U->getValue(); - auto I = ExpandedSCEVs.find(Step); - assert(I != ExpandedSCEVs.end() && "SCEV must be expanded at this point"); - return I->second; + Value *V = ExpandedSCEVs.lookup(Step); + assert(V && "SCEV must be expanded at this point"); + return V; } /// Knowing that loop \p L executes a single vector iteration, add instructions @@ -10159,8 +10159,8 @@ preparePlanForEpilogueVectorLoop(VPlan &Plan, Loop *L, auto *ExpandR = dyn_cast(&R); if (!ExpandR) continue; - auto *ExpandedVal = - Plan.getOrAddLiveIn(ExpandedSCEVs.find(ExpandR->getSCEV())->second); + VPValue *ExpandedVal = + Plan.getOrAddLiveIn(ExpandedSCEVs.lookup(ExpandR->getSCEV())); ExpandR->replaceAllUsesWith(ExpandedVal); if (Plan.getTripCount() == ExpandR) Plan.resetTripCount(ExpandedVal);