Craig Topper | aa5f524 | 2017-04-06 05:28:41 +0000 | [diff] [blame^] | 1 | ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py |
| 2 | ; RUN: opt < %s -instsimplify -S | FileCheck %s |
| 3 | |
| 4 | define i1 @test1(i1 %a) { |
| 5 | ; CHECK-LABEL: @test1( |
| 6 | ; CHECK-NEXT: ret i1 true |
| 7 | ; |
| 8 | %b = xor i1 %a, true |
| 9 | %res = sub i1 %a, %b |
| 10 | ret i1 %res |
| 11 | } |
| 12 | |
| 13 | define <2 x i1> @test2(<2 x i1> %a) { |
| 14 | ; CHECK-LABEL: @test2( |
| 15 | ; CHECK-NEXT: ret <2 x i1> <i1 true, i1 true> |
| 16 | ; |
| 17 | %b = xor <2 x i1> %a, <i1 true, i1 true> |
| 18 | %res = sub <2 x i1> %a, %b |
| 19 | ret <2 x i1> %res |
| 20 | } |
| 21 | |
| 22 | define i1 @test5(i1 %a) { |
| 23 | ; CHECK-LABEL: @test5( |
| 24 | ; CHECK-NEXT: ret i1 false |
| 25 | ; |
| 26 | %res = add i1 %a, %a |
| 27 | ret i1 %res |
| 28 | } |
| 29 | |
| 30 | define <2 x i1> @test6(<2 x i1> %a) { |
| 31 | ; CHECK-LABEL: @test6( |
| 32 | ; CHECK-NEXT: ret <2 x i1> zeroinitializer |
| 33 | ; |
| 34 | %res = add <2 x i1> %a, %a |
| 35 | ret <2 x i1> %res |
| 36 | } |