diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:17:27 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:17:27 +0000 |
commit | 67c32a98315f785a9ec9d531c1f571a0196c7463 (patch) | |
tree | 4abb9cbeecc7901726dd0b4a37369596c852e9ef /test/Transforms/InstCombine/icmp-logical.ll | |
parent | 9f61947910e6ab40de38e6b4034751ef1513200f (diff) |
Diffstat (limited to 'test/Transforms/InstCombine/icmp-logical.ll')
-rw-r--r-- | test/Transforms/InstCombine/icmp-logical.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp-logical.ll b/test/Transforms/InstCombine/icmp-logical.ll index d5d8cbc8c26e..faae2016e207 100644 --- a/test/Transforms/InstCombine/icmp-logical.ll +++ b/test/Transforms/InstCombine/icmp-logical.ll @@ -150,3 +150,23 @@ define i1 @nomask_rhs(i32 %in) { %val = or i1 %tst1, %tst2 ret i1 %val } + +define i1 @fold_mask_cmps_to_false(i32 %x) { +; CHECK-LABEL: @fold_mask_cmps_to_false +; CHECK: ret i1 false + %1 = and i32 %x, 2147483647 + %2 = icmp eq i32 %1, 0 + %3 = icmp eq i32 %x, 2147483647 + %4 = and i1 %3, %2 + ret i1 %4 +} + +define i1 @fold_mask_cmps_to_true(i32 %x) { +; CHECK-LABEL: @fold_mask_cmps_to_true +; CHECK: ret i1 true + %1 = and i32 %x, 2147483647 + %2 = icmp ne i32 %1, 0 + %3 = icmp ne i32 %x, 2147483647 + %4 = or i1 %3, %2 + ret i1 %4 +} |