1 ; This test makes sure that these instructions are properly eliminated.
3 ; RUN: opt < %s -instcombine -S | FileCheck %s
6 define i1 @test0(i32 %A) {
8 ; CHECK: %C = icmp slt i32 %A, 0
9 %B = xor i32 %A, -2147483648
10 %C = icmp sgt i32 %B, -1
14 define i1 @test1(i32 %A) {
16 ; CHECK: %C = icmp slt i32 %A, 0
17 %B = xor i32 %A, 12345
18 %C = icmp slt i32 %B, 0
23 define i32 @test2(i32 %tmp1) {
25 ; CHECK-NEXT: and i32 %tmp1, 32
26 ; CHECK-NEXT: or i32 %ovm, 8
28 %ovm = and i32 %tmp1, 32
29 %ov3 = add i32 %ovm, 145
30 %ov110 = xor i32 %ov3, 153
34 define i32 @test3(i32 %tmp1) {
36 ; CHECK-NEXT: and i32 %tmp1, 32
37 ; CHECK-NEXT: or i32 %ovm, 8
39 %ovm = or i32 %tmp1, 145
40 %ov31 = and i32 %ovm, 177
41 %ov110 = xor i32 %ov31, 153
45 define i32 @test4(i32 %A, i32 %B) {
51 ; CHECK: %1 = ashr i32 %A, %B