[llvm] [VPlan] Add VPWidenInduction recipe as common base class (NFC). (PR #120008)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 15 12:50:33 PST 2024
================
@@ -655,10 +655,10 @@ define void @print_expand_scev(i64 %y, ptr %ptr) {
; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
; CHECK-NEXT: WIDEN-INDUCTION\l" +
; CHECK-NEXT: " %iv = phi %iv.next, 0\l" +
-; CHECK-NEXT: " ir<%v2>, vp<[[EXP_SCEV]]>, vp<[[VF]]>
+; CHECK-NEXT: " %v2 = trunc %iv, vp<[[EXP_SCEV]]>, vp<[[VF]]>
; CHECK-NEXT: vp<[[DERIVED_IV:%.+]]> = DERIVED-IV ir<0> + vp<[[CAN_IV]]> * vp<[[EXP_SCEV]]>
; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[DERIVED_IV]]>, vp<[[EXP_SCEV]]>
-; CHECK-NEXT: WIDEN ir<%v3> = add nuw ir<%v2>, ir<1>
+; CHECK-NEXT: WIDEN ir<%v3> = add nuw ir<%iv>, ir<1>
----------------
fhahn wrote:
The patch changes `VPWidenIntOrFpInductionRecipe` to always use the phi node as underlying value (for consistency and to make it easier to retrieve it generically), whereas before the Trunc would be the underlying value.
This wasn't really obvious from the old printing for VPWidenIntOrFpInductionRecipe, which didn't show the result VPValue and VPValue operands properly. Modernized printing in 43045051d4114f2490bf0e6b01a7969d5c27ee04, hopefully clearer now and more in line with printing for other recipes.
https://github.com/llvm/llvm-project/pull/120008
More information about the llvm-commits
mailing list