diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index c4110582da1ef..888437bf42b23 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -6953,15 +6953,6 @@ static bool planContainsAdditionalSimplifications(VPlan &Plan, VPCostContext &CostCtx, Loop *TheLoop, ElementCount VF) { - // First collect all instructions for the recipes in Plan. - auto GetInstructionForCost = [](const VPRecipeBase *R) -> Instruction * { - if (auto *S = dyn_cast(R)) - return dyn_cast_or_null(S->getUnderlyingValue()); - if (auto *WidenMem = dyn_cast(R)) - return &WidenMem->getIngredient(); - return nullptr; - }; - DenseSet SeenInstrs; auto Iter = vp_depth_first_deep(Plan.getVectorLoopRegion()->getEntry()); for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly(Iter)) { @@ -6999,17 +6990,6 @@ static bool planContainsAdditionalSimplifications(VPlan &Plan, RepR->getUnderlyingInstr(), VF)) return true; } - if (Instruction *UI = GetInstructionForCost(&R)) { - // If we adjusted the predicate of the recipe, the cost in the legacy - // cost model may be different. - if (auto *WidenCmp = dyn_cast(&R)) { - if ((WidenCmp->getOpcode() == Instruction::ICmp || - WidenCmp->getOpcode() == Instruction::FCmp) && - WidenCmp->getPredicate() != cast(UI)->getPredicate()) - return true; - } - SeenInstrs.insert(UI); - } } }