]> granicus.if.org Git - llvm/commitdiff
[InstCombine] add icmp (shr X, Y), 0 test; NFC
authorSanjay Patel <spatel@rotateright.com>
Mon, 2 Oct 2017 20:07:15 +0000 (20:07 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 2 Oct 2017 20:07:15 +0000 (20:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314710 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/icmp-shr.ll

index e002b2033adb4ace41f1a7d2b2d65618f90a61d8..214f315f31785f4adf772cfed12f6ba627752ec1 100644 (file)
@@ -493,3 +493,17 @@ define i1 @exact_multiuse(i32 %x) {
   ret i1 %cmp
 }
 
+declare void @foo2(<2 x i32>)
+define <2 x i1> @exact_eq0_multiuse(<2 x i32> %x, <2 x i32> %y) {
+; CHECK-LABEL: @exact_eq0_multiuse(
+; CHECK-NEXT:    [[SH:%.*]] = ashr exact <2 x i32> %x, %y
+; CHECK-NEXT:    [[CMP:%.*]] = icmp eq <2 x i32> [[SH]], zeroinitializer
+; CHECK-NEXT:    call void @foo2(<2 x i32> [[SH]])
+; CHECK-NEXT:    ret <2 x i1> [[CMP]]
+;
+  %sh = ashr exact <2 x i32> %x, %y
+  %cmp = icmp eq <2 x i32> %sh, zeroinitializer
+  call void @foo2(<2 x i32> %sh)
+  ret <2 x i1> %cmp
+}
+