From ce86ab3ed7fea8d75a9397e8338da6a4fee89ae9 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Mon, 2 Oct 2017 18:16:17 +0000 Subject: [PATCH] [InstCombine] add icmp (lshr X, C1), C2 test; NFC llvm-svn: 314696 --- llvm/test/Transforms/InstCombine/icmp-shr.ll | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/llvm/test/Transforms/InstCombine/icmp-shr.ll b/llvm/test/Transforms/InstCombine/icmp-shr.ll index af608f3666e6..eba9151a4859 100644 --- a/llvm/test/Transforms/InstCombine/icmp-shr.ll +++ b/llvm/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 +} +