[llvm] 59328ab - llvm-reduce: Add -abort-on-invalid-reduction to MIR tests

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 07:28:31 PDT 2022


Author: Matt Arsenault
Date: 2022-06-07T10:28:23-04:00
New Revision: 59328ab0ce4ba9c4018a636752a48c9363c2a98f

URL: https://github.com/llvm/llvm-project/commit/59328ab0ce4ba9c4018a636752a48c9363c2a98f
DIFF: https://github.com/llvm/llvm-project/commit/59328ab0ce4ba9c4018a636752a48c9363c2a98f.diff

LOG: llvm-reduce: Add -abort-on-invalid-reduction to MIR tests

Ideally reductions would never produce invalid IR, and we shouldn't
regress on cases that already avoid doing so.

Added: 
    

Modified: 
    llvm/test/tools/llvm-reduce/mir/drop-ir-references.mir
    llvm/test/tools/llvm-reduce/mir/instr-reduce.mir
    llvm/test/tools/llvm-reduce/mir/multiple-functions.mir
    llvm/test/tools/llvm-reduce/mir/preserve-block-info.mir
    llvm/test/tools/llvm-reduce/mir/preserve-frame-info.mir
    llvm/test/tools/llvm-reduce/mir/preserve-func-info.mir
    llvm/test/tools/llvm-reduce/mir/preserve-machine-function-info-amdgpu.mir
    llvm/test/tools/llvm-reduce/mir/preserve-machine-function-info-riscv.mir
    llvm/test/tools/llvm-reduce/mir/preserve-max-call-frame-size.mir
    llvm/test/tools/llvm-reduce/mir/preserve-mem-operands.mir
    llvm/test/tools/llvm-reduce/mir/preserve-reg-hints.mir
    llvm/test/tools/llvm-reduce/mir/reduce-instruction-flags.mir
    llvm/test/tools/llvm-reduce/mir/reduce-instruction-unreachable-block.mir
    llvm/test/tools/llvm-reduce/mir/reduce-register-hints.mir
    llvm/test/tools/llvm-reduce/mir/remove-frame-destroy.mir
    llvm/test/tools/llvm-reduce/mir/subreg-def0.mir
    llvm/test/tools/llvm-reduce/mir/subreg-def1.mir
    llvm/test/tools/llvm-reduce/mir/undef-virt-reg.mir

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-reduce/mir/drop-ir-references.mir b/llvm/test/tools/llvm-reduce/mir/drop-ir-references.mir
index 88d95666bbb3..abd3ff1a875a 100644
--- a/llvm/test/tools/llvm-reduce/mir/drop-ir-references.mir
+++ b/llvm/test/tools/llvm-reduce/mir/drop-ir-references.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce -simplify-mir -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: G_LOAD

diff  --git a/llvm/test/tools/llvm-reduce/mir/instr-reduce.mir b/llvm/test/tools/llvm-reduce/mir/instr-reduce.mir
index 6fc310cba967..2f90e69e4c14 100644
--- a/llvm/test/tools/llvm-reduce/mir/instr-reduce.mir
+++ b/llvm/test/tools/llvm-reduce/mir/instr-reduce.mir
@@ -1,4 +1,4 @@
-# RUN: llvm-reduce --delta-passes=instructions -mtriple=riscv32 --test %python --test-arg %p/instr-reduce.py %s -o %t
+# RUN: llvm-reduce -abort-on-invalid-reduction --delta-passes=instructions -mtriple=riscv32 --test %python --test-arg %p/instr-reduce.py %s -o %t
 # RUN: cat %t | FileCheck --match-full-lines %s
 
 # REQUIRES: riscv-registered-target

diff  --git a/llvm/test/tools/llvm-reduce/mir/multiple-functions.mir b/llvm/test/tools/llvm-reduce/mir/multiple-functions.mir
index e83ce844ea76..d3a49ab3a0e4 100644
--- a/llvm/test/tools/llvm-reduce/mir/multiple-functions.mir
+++ b/llvm/test/tools/llvm-reduce/mir/multiple-functions.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce -simplify-mir -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: S_NOP 0

diff  --git a/llvm/test/tools/llvm-reduce/mir/preserve-block-info.mir b/llvm/test/tools/llvm-reduce/mir/preserve-block-info.mir
index 098adb75828e..ad54a85437fe 100644
--- a/llvm/test/tools/llvm-reduce/mir/preserve-block-info.mir
+++ b/llvm/test/tools/llvm-reduce/mir/preserve-block-info.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce -simplify-mir --delta-passes=instructions -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir --delta-passes=instructions -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --match-full-lines --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: V_MOV_B32

diff  --git a/llvm/test/tools/llvm-reduce/mir/preserve-frame-info.mir b/llvm/test/tools/llvm-reduce/mir/preserve-frame-info.mir
index 1a8919496715..d7ad5f88874d 100644
--- a/llvm/test/tools/llvm-reduce/mir/preserve-frame-info.mir
+++ b/llvm/test/tools/llvm-reduce/mir/preserve-frame-info.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce -simplify-mir -mtriple=amdgcn-amd-amdhsa --delta-passes=instructions --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir -mtriple=amdgcn-amd-amdhsa --delta-passes=instructions --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --match-full-lines --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS-COUNT-15: V_MOV_B32

diff  --git a/llvm/test/tools/llvm-reduce/mir/preserve-func-info.mir b/llvm/test/tools/llvm-reduce/mir/preserve-func-info.mir
index aa43455d732c..22e41bf03001 100644
--- a/llvm/test/tools/llvm-reduce/mir/preserve-func-info.mir
+++ b/llvm/test/tools/llvm-reduce/mir/preserve-func-info.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce -simplify-mir -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: V_MOV_B32

diff  --git a/llvm/test/tools/llvm-reduce/mir/preserve-machine-function-info-amdgpu.mir b/llvm/test/tools/llvm-reduce/mir/preserve-machine-function-info-amdgpu.mir
index 1c8e8e257b77..7870d416f8df 100644
--- a/llvm/test/tools/llvm-reduce/mir/preserve-machine-function-info-amdgpu.mir
+++ b/llvm/test/tools/llvm-reduce/mir/preserve-machine-function-info-amdgpu.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce -simplify-mir -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS-COUNT-6: S_NOP

diff  --git a/llvm/test/tools/llvm-reduce/mir/preserve-machine-function-info-riscv.mir b/llvm/test/tools/llvm-reduce/mir/preserve-machine-function-info-riscv.mir
index c7f0d3307c77..035051e2e8c6 100644
--- a/llvm/test/tools/llvm-reduce/mir/preserve-machine-function-info-riscv.mir
+++ b/llvm/test/tools/llvm-reduce/mir/preserve-machine-function-info-riscv.mir
@@ -1,5 +1,5 @@
 # REQUIRES: riscv-registered-target
-# RUN: llvm-reduce -simplify-mir --delta-passes=instructions -mtriple=riscv64-- --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir --delta-passes=instructions -mtriple=riscv64-- --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: ADDW

diff  --git a/llvm/test/tools/llvm-reduce/mir/preserve-max-call-frame-size.mir b/llvm/test/tools/llvm-reduce/mir/preserve-max-call-frame-size.mir
index 393232553b4d..2293ee6efe2e 100644
--- a/llvm/test/tools/llvm-reduce/mir/preserve-max-call-frame-size.mir
+++ b/llvm/test/tools/llvm-reduce/mir/preserve-max-call-frame-size.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce -simplify-mir -mtriple=amdgcn-amd-amdhsa --delta-passes=instructions --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir -mtriple=amdgcn-amd-amdhsa --delta-passes=instructions --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --match-full-lines --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: S_ENDPGM

diff  --git a/llvm/test/tools/llvm-reduce/mir/preserve-mem-operands.mir b/llvm/test/tools/llvm-reduce/mir/preserve-mem-operands.mir
index c5d394f2f578..c5aeb0ae3d6f 100644
--- a/llvm/test/tools/llvm-reduce/mir/preserve-mem-operands.mir
+++ b/llvm/test/tools/llvm-reduce/mir/preserve-mem-operands.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce -simplify-mir --delta-passes=instructions -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir --delta-passes=instructions -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --match-full-lines --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: G_LOAD

diff  --git a/llvm/test/tools/llvm-reduce/mir/preserve-reg-hints.mir b/llvm/test/tools/llvm-reduce/mir/preserve-reg-hints.mir
index 2589be95b09a..ae55990c1ad8 100644
--- a/llvm/test/tools/llvm-reduce/mir/preserve-reg-hints.mir
+++ b/llvm/test/tools/llvm-reduce/mir/preserve-reg-hints.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce -mtriple=amdgcn-amd-amdhsa --delta-passes=instructions --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -mtriple=amdgcn-amd-amdhsa --delta-passes=instructions --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --match-full-lines --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: S_NOP 0

diff  --git a/llvm/test/tools/llvm-reduce/mir/reduce-instruction-flags.mir b/llvm/test/tools/llvm-reduce/mir/reduce-instruction-flags.mir
index 90f086131957..1ef50a27b250 100644
--- a/llvm/test/tools/llvm-reduce/mir/reduce-instruction-flags.mir
+++ b/llvm/test/tools/llvm-reduce/mir/reduce-instruction-flags.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce -simplify-mir --delta-passes=instruction-flags -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir --delta-passes=instruction-flags -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: V_ADD_F32

diff  --git a/llvm/test/tools/llvm-reduce/mir/reduce-instruction-unreachable-block.mir b/llvm/test/tools/llvm-reduce/mir/reduce-instruction-unreachable-block.mir
index 32abcf14f14d..1534f61ab4a3 100644
--- a/llvm/test/tools/llvm-reduce/mir/reduce-instruction-unreachable-block.mir
+++ b/llvm/test/tools/llvm-reduce/mir/reduce-instruction-unreachable-block.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce -simplify-mir -mtriple=amdgcn-amd-amdhsa --delta-passes=instructions --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir -mtriple=amdgcn-amd-amdhsa --delta-passes=instructions --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --check-prefix=RESULT %s < %t
 
 # Make sure there's no crash with unreachable blocks.

diff  --git a/llvm/test/tools/llvm-reduce/mir/reduce-register-hints.mir b/llvm/test/tools/llvm-reduce/mir/reduce-register-hints.mir
index 5d6fd45c17bc..aa3f33cfd5c4 100644
--- a/llvm/test/tools/llvm-reduce/mir/reduce-register-hints.mir
+++ b/llvm/test/tools/llvm-reduce/mir/reduce-register-hints.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce -simplify-mir --delta-passes=register-hints -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir --delta-passes=register-hints -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: - { id: 0, class: vgpr_32, preferred-register: '$vgpr0' }

diff  --git a/llvm/test/tools/llvm-reduce/mir/remove-frame-destroy.mir b/llvm/test/tools/llvm-reduce/mir/remove-frame-destroy.mir
index 7a7edcbf75e3..8ee38905647d 100644
--- a/llvm/test/tools/llvm-reduce/mir/remove-frame-destroy.mir
+++ b/llvm/test/tools/llvm-reduce/mir/remove-frame-destroy.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce --delta-passes=instructions -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction --delta-passes=instructions -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: S_NOP 0

diff  --git a/llvm/test/tools/llvm-reduce/mir/subreg-def0.mir b/llvm/test/tools/llvm-reduce/mir/subreg-def0.mir
index 412e6a8f985e..75a4f10d6280 100644
--- a/llvm/test/tools/llvm-reduce/mir/subreg-def0.mir
+++ b/llvm/test/tools/llvm-reduce/mir/subreg-def0.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce --delta-passes=instructions -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction --delta-passes=instructions -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --match-full-lines --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: V_ADD_U32

diff  --git a/llvm/test/tools/llvm-reduce/mir/subreg-def1.mir b/llvm/test/tools/llvm-reduce/mir/subreg-def1.mir
index 84483a11c9e3..0b0bef0c47ce 100644
--- a/llvm/test/tools/llvm-reduce/mir/subreg-def1.mir
+++ b/llvm/test/tools/llvm-reduce/mir/subreg-def1.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce --delta-passes=instructions -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction --delta-passes=instructions -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --match-full-lines --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: %{{[0-9]+}}.sub0:vreg_64 = V_ADD_U32_e32 %{{[0-9]+}}.sub1, %{{[0-9]+}}.sub0, implicit $exec

diff  --git a/llvm/test/tools/llvm-reduce/mir/undef-virt-reg.mir b/llvm/test/tools/llvm-reduce/mir/undef-virt-reg.mir
index 6103bb1ceab1..d32b8bd265c4 100644
--- a/llvm/test/tools/llvm-reduce/mir/undef-virt-reg.mir
+++ b/llvm/test/tools/llvm-reduce/mir/undef-virt-reg.mir
@@ -1,5 +1,5 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llvm-reduce --delta-passes=instructions -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
+# RUN: llvm-reduce -abort-on-invalid-reduction --delta-passes=instructions -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
 # RUN: FileCheck --match-full-lines --check-prefix=RESULT %s < %t
 
 # CHECK-INTERESTINGNESS: S_NOP 0


        


More information about the llvm-commits mailing list