diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-10-02 18:16:17 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-10-02 18:16:17 +0000 |
commit | 03048ddd782b239c0a49509a405b3620eaea6c87 (patch) | |
tree | a10e489239f76abd5053b4f27c3ee60a3b91443d /test/Transforms/InstCombine/icmp-shr.ll | |
parent | 50b210a97a629f1787c879037af5f0beaccc69f2 (diff) |
[InstCombine] add icmp (lshr X, C1), C2 test; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/icmp-shr.ll')
-rw-r--r-- | test/Transforms/InstCombine/icmp-shr.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp-shr.ll b/test/Transforms/InstCombine/icmp-shr.ll index af608f3666e..eba9151a485 100644 --- a/test/Transforms/InstCombine/icmp-shr.ll +++ b/test/Transforms/InstCombine/icmp-shr.ll @@ -478,3 +478,18 @@ define i1 @PR24873(i64 %V) { ret i1 %icmp } +declare void @foo(i32) + +define i1 @exact_multiuse(i32 %x) { +; CHECK-LABEL: @exact_multiuse( +; CHECK-NEXT: [[SH:%.*]] = lshr exact i32 %x, 7 +; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[SH]], 1024 +; CHECK-NEXT: call void @foo(i32 [[SH]]) +; CHECK-NEXT: ret i1 [[CMP]] +; + %sh = lshr exact i32 %x, 7 + %cmp = icmp eq i32 %sh, 1024 + call void @foo(i32 %sh) + ret i1 %cmp +} + |