Andrei Elovikov 8e335d5336
[UTC][VPlan] Use -vplan-print-after for VPlan-dump-based tests (#178736)
Switch tests from using `-debug[-only=LoopVectorize]` to
`-vplan-print-after` as that provides better control at what step in the
pipeline we want to check the VPlan (I'm using `optimize$` for now to
preserve previous state).

Then, update `-vplan-print-after*` to print what function the loop
belongs to. That enables us to simplify VPlan UTC support as the output
of the updated tests contains the VPlan dump only - no special
filtering/extraction is necessary anymore.
2026-02-12 20:14:07 +00:00

30 lines
1.0 KiB
LLVM

; RUN: opt -passes=loop-vectorize -disable-output -force-vector-width=4 < %s \
; RUN: -vplan-print-after=simplify -vplan-print-after=printFinalVPlan \
; RUN: 2>&1 | FileCheck %s --implicit-check-not "VPlan after"
; REQUIRES: asserts
; CHECK: VPlan for loop in 'foo' after simplifyRecipes
; CHECK-NEXT: VPlan 'Initial VPlan for VF={4},UF>=1' {
; CHECK: VPlan for loop in 'foo' after simplifyBlends
; CHECK-NEXT: VPlan 'Initial VPlan for VF={4},UF>=1' {
; CHECK: VPlan for loop in 'foo' after simplifyRecipes
; CHECK-NEXT: VPlan 'Initial VPlan for VF={4},UF>=1' {
; CHECK: VPlan for loop in 'foo' after printFinalVPlan
; CHECK-NEXT: VPlan 'Final VPlan for VF={4},UF={1}' {
define void @foo(ptr %ptr, i64 %n) {
entry:
br label %header
header:
%iv = phi i64 [ 0, %entry ], [ %iv.next, %header ]
%gep = getelementptr i64, ptr %ptr, i64 %iv
store i64 %iv, ptr %gep
%iv.next = add nsw i64 %iv, 1
%exitcond = icmp slt i64 %iv.next, %n
br i1 %exitcond, label %header, label %exit
exit:
ret void
}