[llvm] [VPlan] Model cost of safe-divisor in VPlan (PR #154468)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 20 01:49:12 PDT 2025


================
@@ -7949,6 +7949,7 @@ VPWidenRecipe *VPRecipeBuilder::tryToWiden(Instruction *I,
       VPValue *One =
           Plan.getOrAddLiveIn(ConstantInt::get(I->getType(), 1u, false));
       auto *SafeRHS = Builder.createSelect(Mask, Ops[1], One, I->getDebugLoc());
+      SafeRHS->setUnderlyingValue(I);
----------------
david-arm wrote:

However, I'm happy to pull this into https://github.com/llvm/llvm-project/pull/152707 if we're happy with the potential impact of having the same underlying value for multiple recipes. It would reduce the scope of my PR to strictly divides. Any thoughts @fhahn?

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


More information about the llvm-commits mailing list