[llvm] r314696 - [InstCombine] add icmp (lshr X, C1), C2 test; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 2 11:16:18 PDT 2017
Author: spatel
Date: Mon Oct 2 11:16:17 2017
New Revision: 314696
URL: http://llvm.org/viewvc/llvm-project?rev=314696&view=rev
Log:
[InstCombine] add icmp (lshr X, C1), C2 test; NFC
Modified:
llvm/trunk/test/Transforms/InstCombine/icmp-shr.ll
Modified: llvm/trunk/test/Transforms/InstCombine/icmp-shr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp-shr.ll?rev=314696&r1=314695&r2=314696&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/icmp-shr.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/icmp-shr.ll Mon Oct 2 11:16:17 2017
@@ -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
+}
+
More information about the llvm-commits
mailing list