[llvm] [LV][NFC] Remove use of -print-after=... to verify IR output (PR #194882)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 08:19:55 PDT 2026


https://github.com/david-arm created https://github.com/llvm/llvm-project/pull/194882

In the case of LoopVectorize/loop-scalars.ll this means we can now remove "REQUIRES: asserts" as well.

>From c6ca580c3d4d2e2a8c9adfdffbaddbb8016d6523 Mon Sep 17 00:00:00 2001
From: David Sherwood <david.sherwood at arm.com>
Date: Wed, 29 Apr 2026 15:13:56 +0000
Subject: [PATCH] [LV][NFC] Remove use of -print-after=... to verify IR output

In the case of LoopVectorize/loop-scalars.ll this means we can
now remove "REQUIRES: asserts" as well.
---
 .../X86/consecutive-ptr-uniforms.ll           | 23 ++++++++++---------
 .../Transforms/LoopVectorize/loop-scalars.ll  |  3 +--
 .../test/Transforms/LoopVectorize/phi-cost.ll | 15 ++++++------
 3 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/llvm/test/Transforms/LoopVectorize/X86/consecutive-ptr-uniforms.ll b/llvm/test/Transforms/LoopVectorize/X86/consecutive-ptr-uniforms.ll
index 23388a4f6fb7d..394aebb8f7964 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/consecutive-ptr-uniforms.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/consecutive-ptr-uniforms.ll
@@ -1,12 +1,13 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals none --filter-out-after "scalar.ph\:" --version 5
 ; REQUIRES: asserts
-; RUN: opt < %s -aa-pipeline=basic-aa -passes=loop-vectorize,instcombine -S -debug-only=loop-vectorize -disable-output -print-after=instcombine 2>&1 | FileCheck %s
+; RUN: opt < %s -aa-pipeline=basic-aa -passes=loop-vectorize,instcombine -S -debug-only=loop-vectorize 2>%t -S | FileCheck %s
+; RUN: cat %t | FileCheck %s --check-prefix=DEBUG
 ; RUN: opt < %s -passes=loop-vectorize -force-vector-width=2 -S | FileCheck %s -check-prefix=FORCE
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-; CHECK-LABEL: PR31671
+; DEBUG-LABEL: PR31671
 ;
 ; Check a pointer in which one of its uses is consecutive-like and another of
 ; its uses is non-consecutive-like. In the test case below, %tmp3 is the
@@ -15,10 +16,10 @@ target triple = "x86_64-unknown-linux-gnu"
 ; scatter operation. %tmp3 (and the induction variable) should not be marked
 ; uniform-after-vectorization.
 ;
-; CHECK:       LV: Found uniform instruction: %tmp0 = getelementptr inbounds %data, ptr %d, i64 0, i32 3, i64 %i
-; CHECK-NOT:   LV: Found uniform instruction: %tmp3 = getelementptr inbounds %data, ptr %d, i64 0, i32 0, i64 %i
-; CHECK-NOT:   LV: Found uniform instruction: %i = phi i64 [ %i.next, %for.body ], [ 0, %entry ]
-; CHECK-NOT:   LV: Found uniform instruction: %i.next = add nuw nsw i64 %i, 5
+; DEBUG:       LV: Found uniform instruction: %tmp0 = getelementptr inbounds %data, ptr %d, i64 0, i32 3, i64 %i
+; DEBUG-NOT:   LV: Found uniform instruction: %tmp3 = getelementptr inbounds %data, ptr %d, i64 0, i32 0, i64 %i
+; DEBUG-NOT:   LV: Found uniform instruction: %i = phi i64 [ %i.next, %for.body ], [ 0, %entry ]
+; DEBUG-NOT:   LV: Found uniform instruction: %i.next = add nuw nsw i64 %i, 5
 
 
 %data = type { [32000 x float], [3 x i32], [4 x i8], [32000 x float] }
@@ -154,17 +155,17 @@ for.end:
 
 attributes #0 = { "target-cpu"="knl" }
 
-; CHECK-LABEL: PR40816
+; DEBUG-LABEL: PR40816
 ;
 ; Check that scalar with predication instructions are not considered uniform
 ; after vectorization, because that results in replicating a region instead of
 ; having a single instance (out of VF). The predication stems from a tiny count
 ; of 3 leading to folding the tail by masking using icmp ule <i, i+1> <= <2, 2>.
 ;
-; CHECK:     LV: Found trip count: 3
-; CHECK:     LV: Found uniform instruction:   {{%.*}} = icmp eq i32 {{%.*}}, 0
-; CHECK-NOT: LV: Found uniform instruction:   {{%.*}} = load i32, ptr {{%.*}}, align 1
-; CHECK:     LV: Found not uniform due to requiring predication:  {{%.*}} = load i32, ptr {{%.*}}, align 1
+; DEBUG:     LV: Found trip count: 3
+; DEBUG:     LV: Found uniform instruction:   {{%.*}} = icmp eq i32 {{%.*}}, 0
+; DEBUG-NOT: LV: Found uniform instruction:   {{%.*}} = load i32, ptr {{%.*}}, align 1
+; DEBUG:     LV: Found not uniform due to requiring predication:  {{%.*}} = load i32, ptr {{%.*}}, align 1
 ;
 ;
 @a = internal constant [3 x i32] [i32 7, i32 7, i32 0], align 1
diff --git a/llvm/test/Transforms/LoopVectorize/loop-scalars.ll b/llvm/test/Transforms/LoopVectorize/loop-scalars.ll
index 24e7cbbed8518..1cfe27f3f8db1 100644
--- a/llvm/test/Transforms/LoopVectorize/loop-scalars.ll
+++ b/llvm/test/Transforms/LoopVectorize/loop-scalars.ll
@@ -1,6 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; REQUIRES: asserts
-; RUN: opt < %s -aa-pipeline=basic-aa -passes=loop-vectorize,instcombine -force-vector-width=2 -force-vector-interleave=1 -debug-only=loop-vectorize -disable-output -print-after=instcombine 2>&1 | FileCheck %s
+; RUN: opt < %s -aa-pipeline=basic-aa -passes=loop-vectorize,instcombine -force-vector-width=2 -force-vector-interleave=1 -S | FileCheck %s
 
 target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
 
diff --git a/llvm/test/Transforms/LoopVectorize/phi-cost.ll b/llvm/test/Transforms/LoopVectorize/phi-cost.ll
index d0a9073d5e5e7..5f98612814ece 100644
--- a/llvm/test/Transforms/LoopVectorize/phi-cost.ll
+++ b/llvm/test/Transforms/LoopVectorize/phi-cost.ll
@@ -1,12 +1,13 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
 ; REQUIRES: asserts
-; RUN: opt < %s -passes='function(loop-vectorize,instcombine)' -force-vector-width=2 -force-vector-interleave=1 -debug-only=loop-vectorize -disable-output -print-after=instcombine 2>&1 | FileCheck %s
+; RUN: opt < %s -passes='function(loop-vectorize,instcombine)' -force-vector-width=2 -force-vector-interleave=1 -debug-only=loop-vectorize 2>%t -S | FileCheck %s
+; RUN: cat %s | FileCheck %s --check-prefix=DEBUG
 
 target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
 
-; CHECK-LABEL: phi_two_incoming_values
-; CHECK:       Cost of 1 for VF 2: induction instruction   %i = phi i64 [ %i.next, %if.end ], [ 0, %entry ]
-; CHECK:       Cost of 1 for VF 2: BLEND ir<%tmp5> = ir<%tmp1> ir<%tmp4>/ir<%tmp3>
+; DEBUG-LABEL: phi_two_incoming_values
+; DEBUG:       Cost of 1 for VF 2: induction instruction   %i = phi i64 [ %i.next, %if.end ], [ 0, %entry ]
+; DEBUG:       Cost of 1 for VF 2: BLEND ir<%tmp5> = ir<%tmp1> ir<%tmp4>/ir<%tmp3>
 ;
 define void @phi_two_incoming_values(ptr noalias %a, ptr noalias %b, i64 %n) {
 ; CHECK-LABEL: define void @phi_two_incoming_values(
@@ -81,9 +82,9 @@ for.end:
   ret void
 }
 
-; CHECK-LABEL: phi_three_incoming_values
-; CHECK:       Cost of 1 for VF 2: induction instruction   %i = phi i64 [ %i.next, %if.end ], [ 0, %entry ]
-; CHECK:       Cost of 2 for VF 2: BLEND ir<%tmp8> = ir<%tmp7> ir<3>/vp<{{.*}}> ir<9>/vp<{{.*}}>
+; DEBUG-LABEL: phi_three_incoming_values
+; DEBUG:       Cost of 1 for VF 2: induction instruction   %i = phi i64 [ %i.next, %if.end ], [ 0, %entry ]
+; DEBUG:       Cost of 2 for VF 2: BLEND ir<%tmp8> = ir<%tmp7> ir<3>/vp<{{.*}}> ir<9>/vp<{{.*}}>
 ;
 define void @phi_three_incoming_values(ptr noalias %a, ptr noalias %b, i64 %n) {
 ; CHECK-LABEL: define void @phi_three_incoming_values(



More information about the llvm-commits mailing list