[llvm] 128da94 - [InstCombine] Remove disable-verify tests (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed May 18 05:48:58 PDT 2022


Author: Nikita Popov
Date: 2022-05-18T14:48:48+02:00
New Revision: 128da94d38242c28e6bf23ad025e0cb2d6ce9e4f

URL: https://github.com/llvm/llvm-project/commit/128da94d38242c28e6bf23ad025e0cb2d6ce9e4f
DIFF: https://github.com/llvm/llvm-project/commit/128da94d38242c28e6bf23ad025e0cb2d6ce9e4f.diff

LOG: [InstCombine] Remove disable-verify tests (NFC)

InstCombine is not required to do anything sensible if it receives
invalid IR.

These tests seem to be testing self-referential instructions that
may occur in unreachable code -- but InstCombine actually goes out
of the way to remove such instructions ahead of time so it doesn't
need to deal with them.

Added: 
    

Modified: 
    

Removed: 
    llvm/test/Transforms/InstCombine/objsize-noverify.ll
    llvm/test/Transforms/InstCombine/select-crash-noverify.ll


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/objsize-noverify.ll b/llvm/test/Transforms/InstCombine/objsize-noverify.ll
deleted file mode 100644
index f1d0392c1845c..0000000000000
--- a/llvm/test/Transforms/InstCombine/objsize-noverify.ll
+++ /dev/null
@@ -1,78 +0,0 @@
-; Test objectsize bounds checking that won't verify until after -instcombine.
-; RUN: opt < %s -disable-verify -instcombine -S | opt -S | FileCheck %s
-; We need target data to get the sizes of the arrays and structures.
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-
-declare i32 @llvm.objectsize.i32.p0i8(i8*, i1) nounwind readonly
-
-; CHECK-LABEL: @PR13390(
-define i32 @PR13390(i1 %bool, i8* %a) {
-entry:
-  %cond = or i1 %bool, true
-  br i1 %cond, label %return, label %xpto
-
-xpto:
-  %select = select i1 %bool, i8* %select, i8* %a
-  %select2 = select i1 %bool, i8* %a, i8* %select2
-  %0 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %select, i1 true)
-  %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %select2, i1 true)
-  %2 = add i32 %0, %1
-; CHECK: ret i32 undef
-  ret i32 %2
-
-return:
-  ret i32 42
-}
-
-define i32 @PR13390_logical(i1 %bool, i8* %a) {
-entry:
-  %cond = select i1 %bool, i1 true, i1 true
-  br i1 %cond, label %return, label %xpto
-
-xpto:
-  %select = select i1 %bool, i8* %select, i8* %a
-  %select2 = select i1 %bool, i8* %a, i8* %select2
-  %0 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %select, i1 true)
-  %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %select2, i1 true)
-  %2 = add i32 %0, %1
-; CHECK: ret i32 undef
-  ret i32 %2
-
-return:
-  ret i32 42
-}
-
-; CHECK-LABEL: @PR13621(
-define i32 @PR13621(i1 %bool) nounwind {
-entry:
-  %cond = or i1 %bool, true
-  br i1 %cond, label %return, label %xpto
-
-; technically reachable, but this malformed IR may appear as a result of constant propagation
-xpto:
-  %gep2 = getelementptr i8, i8* %gep, i32 1
-  %gep = getelementptr i8, i8* %gep2, i32 1
-  %o = call i32 @llvm.objectsize.i32.p0i8(i8* %gep, i1 true)
-; CHECK: ret i32 undef
-  ret i32 %o
-
-return:
-  ret i32 7
-}
-
-define i32 @PR13621_logical(i1 %bool) nounwind {
-entry:
-  %cond = select i1 %bool, i1 true, i1 true
-  br i1 %cond, label %return, label %xpto
-
-; technically reachable, but this malformed IR may appear as a result of constant propagation
-xpto:
-  %gep2 = getelementptr i8, i8* %gep, i32 1
-  %gep = getelementptr i8, i8* %gep2, i32 1
-  %o = call i32 @llvm.objectsize.i32.p0i8(i8* %gep, i1 true)
-; CHECK: ret i32 undef
-  ret i32 %o
-
-return:
-  ret i32 7
-}

diff  --git a/llvm/test/Transforms/InstCombine/select-crash-noverify.ll b/llvm/test/Transforms/InstCombine/select-crash-noverify.ll
deleted file mode 100644
index 974dd73c2c1ef..0000000000000
--- a/llvm/test/Transforms/InstCombine/select-crash-noverify.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: opt < %s -disable-verify -passes=instcombine -S | opt -S | FileCheck %s
-; Formerly crashed, PR8490.
-
-; CHECK-LABEL: @test3(
-define i32 @test3(i1 %bool, i32 %a) {
-entry:
-  %cond = or i1 %bool, true
-  br i1 %cond, label %return, label %xpto
-
-; technically reachable, but this malformed IR may appear as a result of constant propagation
-xpto:
-  %select = select i1 %bool, i32 %a, i32 %select
-  %select2 = select i1 %bool, i32 %select2, i32 %a
-  %sum = add i32 %select, %select2
-  ret i32 %sum
-
-return:
-  ret i32 7
-}
-
-define i32 @test3_logical(i1 %bool, i32 %a) {
-entry:
-  %cond = select i1 %bool, i1 true, i1 true
-  br i1 %cond, label %return, label %xpto
-
-; technically reachable, but this malformed IR may appear as a result of constant propagation
-xpto:
-  %select = select i1 %bool, i32 %a, i32 %select
-  %select2 = select i1 %bool, i32 %select2, i32 %a
-  %sum = add i32 %select, %select2
-  ret i32 %sum
-
-return:
-  ret i32 7
-}


        


More information about the llvm-commits mailing list