diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2017-05-17 23:22:52 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2017-05-17 23:22:52 +0000 |
| commit | 7f4687f164fd278eb675bb481faf178606e64c23 (patch) | |
| tree | 5c5727f545b5436ebc1dda0ddffa85af53e82d8e | |
| parent | 48187cffe2b55d99c655ad38aeca308d02303e95 (diff) | |
| download | bcm5719-llvm-7f4687f164fd278eb675bb481faf178606e64c23.tar.gz bcm5719-llvm-7f4687f164fd278eb675bb481faf178606e64c23.zip | |
[InstCombine] add test for xor-of-icmps; NFC
This is another form of the problem discussed in D32143.
llvm-svn: 303315
| -rw-r--r-- | llvm/test/Transforms/InstCombine/set.ll | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/set.ll b/llvm/test/Transforms/InstCombine/set.ll index 5955eaea2c2..84b2ae91fd4 100644 --- a/llvm/test/Transforms/InstCombine/set.ll +++ b/llvm/test/Transforms/InstCombine/set.ll @@ -148,8 +148,6 @@ define <3 x i1> @test14vec(<3 x i1> %A, <3 x i1> %B) { ret <3 x i1> %C } -; FIXME: Not recognizing the icmp bool with constant exposes a missing fold. - define i1 @bool_eq0(i64 %a) { ; CHECK-LABEL: @bool_eq0( ; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt i64 %a, 1 @@ -162,6 +160,21 @@ define i1 @bool_eq0(i64 %a) { ret i1 %and } +; FIXME: This is equivalent to the previous test. + +define i1 @xor_of_icmps(i64 %a) { +; CHECK-LABEL: @xor_of_icmps( +; CHECK-NEXT: [[B:%.*]] = icmp sgt i64 %a, 0 +; CHECK-NEXT: [[C:%.*]] = icmp eq i64 %a, 1 +; CHECK-NEXT: [[XOR:%.*]] = xor i1 [[C]], [[B]] +; CHECK-NEXT: ret i1 [[XOR]] +; + %b = icmp sgt i64 %a, 0 + %c = icmp eq i64 %a, 1 + %xor = xor i1 %c, %b + ret i1 %xor +} + define i1 @test16(i32 %A) { ; CHECK-LABEL: @test16( ; CHECK-NEXT: ret i1 false |

