[llvm] [LV] Strip outdated code in cost-model-matching (PR #154935)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 05:28:25 PDT 2025


================
@@ -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<VPWidenRecipe>(&R)) {
-          if ((WidenCmp->getOpcode() == Instruction::ICmp ||
-               WidenCmp->getOpcode() == Instruction::FCmp) &&
-              WidenCmp->getPredicate() != cast<CmpInst>(UI)->getPredicate())
-            return true;
-        }
-        SeenInstrs.insert(UI);
-      }
----------------
artagnon wrote:

I'm not 100% sure if there will be some cost-model-mismatch due to Luke's patch, but this code doesn't seem to match anything anymore: there was a regression test committed along with the change that introduced this in 043b04a by Florian which seems to pass without this change.

https://github.com/llvm/llvm-project/pull/154935


More information about the llvm-commits mailing list