[llvm] ff8d0b3 - [VPlan] Add test for printing plan with an exit value.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed May 4 09:19:39 PDT 2022
Author: Florian Hahn
Date: 2022-05-04T17:19:02+01:00
New Revision: ff8d0b338f48ab26919ac84aef2c79e1e1a20ef2
URL: https://github.com/llvm/llvm-project/commit/ff8d0b338f48ab26919ac84aef2c79e1e1a20ef2
DIFF: https://github.com/llvm/llvm-project/commit/ff8d0b338f48ab26919ac84aef2c79e1e1a20ef2.diff
LOG: [VPlan] Add test for printing plan with an exit value.
Test for printing plan with additions from D123537.
Added:
Modified:
llvm/test/Transforms/LoopVectorize/vplan-printing.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/LoopVectorize/vplan-printing.ll b/llvm/test/Transforms/LoopVectorize/vplan-printing.ll
index 81593f9c11a54..2ec52e20c897a 100644
--- a/llvm/test/Transforms/LoopVectorize/vplan-printing.ll
+++ b/llvm/test/Transforms/LoopVectorize/vplan-printing.ll
@@ -528,6 +528,49 @@ loop.exit:
ret void
}
+define i32 @print_exit_value(i8* %ptr, i32 %off) {
+; CHECK-LABEL: Checking a loop in 'print_exit_value'
+; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
+; CHECK-NEXT: Live-in vp<[[VEC_TC:%.+]]> = vector-trip-count
+; CHECK-EMPTY:
+; CHECK-NEXT: vector.ph:
+; CHECK-NEXT: Successor(s): vector loop
+; CHECK-EMPTY:
+; CHECK-NEXT: <x1> vector loop: {
+; CHECK-NEXT: vector.body:
+; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION
+; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next, ir<1>
+; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<0>, ir<1>
+; CHECK-NEXT: CLONE ir<%gep> = getelementptr ir<%ptr>, vp<[[STEPS]]>
+; CHECK-NEXT: WIDEN ir<%add> = add ir<%iv>, ir<%off>
+; CHECK-NEXT: WIDEN store ir<%gep>, ir<0>
+; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT:%.+]]> = VF * UF +(nuw) vp<[[CAN_IV]]>
+; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]> vp<[[VEC_TC]]>
+; CHECK-NEXT: No successors
+; CHECK-NEXT: }
+; CHECK-NEXT: Successor(s): middle.block
+; CHECK-EMPTY:
+; CHECK-NEXT: middle.block:
+; CHECK-NEXT: No successors
+; CHECK-NEXT: }
+;
+entry:
+ br label %loop
+
+loop:
+ %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
+ %gep = getelementptr inbounds i8, i8* %ptr, i32 %iv
+ %add = add i32 %iv, %off
+ store i8 0, i8* %gep
+ %iv.next = add nsw i32 %iv, 1
+ %ec = icmp eq i32 %iv.next, 1000
+ br i1 %ec, label %exit, label %loop
+
+exit:
+ %lcssa = phi i32 [ %add, %loop ]
+ ret i32 %lcssa
+}
+
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
More information about the llvm-commits
mailing list