1 ; This test makes sure that these instructions are properly eliminated.
4 ; RUN: opt < %s -instcombine -S | FileCheck %s
7 define i32 @test1(i32 %A) {
13 define i1 @test2(i32 %A, i32 %B) {
14 ; Can change into setge
15 %cond = icmp sle i32 %A, %B
16 %Ret = xor i1 %cond, true
20 ; Test that De Morgan's law can be instcombined.
21 define i32 @test3(i32 %A, i32 %B) {
29 ; Test that De Morgan's law can work with constants.
30 define i32 @test4(i32 %A, i32 %B) {
37 ; Test the mirror of De Morgan's law.
38 define i32 @test5(i32 %A, i32 %B) {
47 define zeroext i8 @test6(i32 %a, i32 %b) {
49 %tmp1not = xor i32 %a, -1
50 %tmp2not = xor i32 %b, -1
51 %tmp3 = icmp slt i32 %tmp1not, %tmp2not
52 %retval67 = zext i1 %tmp3 to i8
56 define <2 x i1> @test7(<2 x i32> %A, <2 x i32> %B) {
57 %cond = icmp sle <2 x i32> %A, %B
58 %Ret = xor <2 x i1> %cond, <i1 true, i1 true>