[llvm] [VPlan] Run initial recipe simplification on VPlan0. (PR #176828)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 11 08:54:42 PST 2026
================
@@ -1219,15 +1219,25 @@ static void simplifyRecipe(VPSingleDefRecipe *Def, VPTypeAnalysis &TypeInfo) {
}
VPBuilder Builder(Def);
+
+ // Avoid replacing VPInstructions with underlying values with new
+ // VPInstructions. VPInstructions with underlying values should get
+ // widened/replicated later.
+ // TODO: We should also not replace non-VPInstructions like VPWidenRecipe with
+ // VPInstructions without underlying values, as those will get skipped during
+ // cost computation.
----------------
fhahn wrote:
Updated with some edits, thanks!
> I had a question: why can't we just set the underlying value of the newly created VPInstruction? What would be the effect of that?
We could in theory but it would be inaccurate, and the widenined logic still uses the underlying instruction to look up cost-based decisions, for which we would use an incorrect instruction.
It would also be inaccurate/misleading, although nothing should rely on the underlying instruction.
https://github.com/llvm/llvm-project/pull/176828
More information about the llvm-commits
mailing list