forked from OSchip/llvm-project
[InstCombine] move test and use better checks; NFC
Previously, this test was checking for 'or i1', but that was actually matched by 'xor i1'. llvm-svn: 303364
This commit is contained in:
parent
1b41409079
commit
0a84eb8d6e
|
@ -1,10 +0,0 @@
|
|||
; RUN: opt < %s -instcombine -S | grep "or i1"
|
||||
; PR2844
|
||||
|
||||
define i32 @test(i32 %p_74) {
|
||||
%A = icmp eq i32 %p_74, 0 ; <i1> [#uses=1]
|
||||
%B = icmp slt i32 %p_74, -638208501 ; <i1> [#uses=1]
|
||||
%or.cond = or i1 %A, %B ; <i1> [#uses=1]
|
||||
%iftmp.10.0 = select i1 %or.cond, i32 0, i32 1 ; <i32> [#uses=1]
|
||||
ret i32 %iftmp.10.0
|
||||
}
|
|
@ -175,6 +175,23 @@ define i1 @xor_of_icmps(i64 %a) {
|
|||
ret i1 %xor
|
||||
}
|
||||
|
||||
; https://bugs.llvm.org/show_bug.cgi?id=2844
|
||||
|
||||
define i32 @PR2844(i32 %x) {
|
||||
; CHECK-LABEL: @PR2844(
|
||||
; CHECK-NEXT: [[A:%.*]] = icmp eq i32 %x, 0
|
||||
; CHECK-NEXT: [[B:%.*]] = icmp sgt i32 %x, -638208502
|
||||
; CHECK-NEXT: [[NOT_OR:%.*]] = xor i1 [[A]], [[B]]
|
||||
; CHECK-NEXT: [[SEL:%.*]] = zext i1 [[NOT_OR]] to i32
|
||||
; CHECK-NEXT: ret i32 [[SEL]]
|
||||
;
|
||||
%A = icmp eq i32 %x, 0
|
||||
%B = icmp slt i32 %x, -638208501
|
||||
%or = or i1 %A, %B
|
||||
%sel = select i1 %or, i32 0, i32 1
|
||||
ret i32 %sel
|
||||
}
|
||||
|
||||
define i1 @test16(i32 %A) {
|
||||
; CHECK-LABEL: @test16(
|
||||
; CHECK-NEXT: ret i1 false
|
||||
|
|
Loading…
Reference in New Issue