]> granicus.if.org Git - llvm/commitdiff
[NFC] Added more tests for D63652
authorDavid Bolvansky <david.bolvansky@gmail.com>
Fri, 21 Jun 2019 16:14:13 +0000 (16:14 +0000)
committerDavid Bolvansky <david.bolvansky@gmail.com>
Fri, 21 Jun 2019 16:14:13 +0000 (16:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364069 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/shl-sub.ll

index d22e5a706b76a4c504c2762057b98431fd9de063..43ba548e92f57b8ba78ab19c8f663aab2b02e743 100644 (file)
@@ -148,5 +148,38 @@ define <2 x i64> @bad_shl_sub_i64_vec(<2 x i64> %x) {
   ret <2 x i64> %r
 }
 
+define <3 x i64> @shl_sub_i64_vec_undef0(<3 x i64> %x) {
+; CHECK-LABEL: @shl_sub_i64_vec_undef0(
+; CHECK-NEXT:    [[S:%.*]] = sub <3 x i64> <i64 63, i64 undef, i64 63>, [[X:%.*]]
+; CHECK-NEXT:    [[R:%.*]] = shl <3 x i64> <i64 1, i64 1, i64 1>, [[S]]
+; CHECK-NEXT:    ret <3 x i64> [[R]]
+;
+  %s = sub <3 x i64> <i64 63, i64 undef, i64 63>, %x
+  %r = shl <3 x i64> <i64 1, i64 1, i64 1>, %s
+  ret <3 x i64> %r
+}
+
+define <3 x i64> @shl_sub_i64_vec_undef1(<3 x i64> %x) {
+; CHECK-LABEL: @shl_sub_i64_vec_undef1(
+; CHECK-NEXT:    [[S:%.*]] = sub <3 x i64> <i64 63, i64 undef, i64 63>, [[X:%.*]]
+; CHECK-NEXT:    [[R:%.*]] = shl <3 x i64> <i64 1, i64 undef, i64 1>, [[S]]
+; CHECK-NEXT:    ret <3 x i64> [[R]]
+;
+  %s = sub <3 x i64> <i64 63, i64 undef, i64 63>, %x
+  %r = shl <3 x i64> <i64 1, i64 undef, i64 1>, %s
+  ret <3 x i64> %r
+}
+
+define <3 x i64> @shl_sub_i64_vec_undef2(<3 x i64> %x) {
+; CHECK-LABEL: @shl_sub_i64_vec_undef2(
+; CHECK-NEXT:    [[S:%.*]] = sub <3 x i64> <i64 63, i64 undef, i64 63>, [[X:%.*]]
+; CHECK-NEXT:    [[R:%.*]] = shl <3 x i64> <i64 1, i64 undef, i64 1>, [[S]]
+; CHECK-NEXT:    ret <3 x i64> [[R]]
+;
+  %s = sub <3 x i64> <i64 63, i64 undef, i64 63>, %x
+  %r = shl <3 x i64> <i64 1, i64 undef, i64 1>, %s
+  ret <3 x i64> %r
+}
+
 
 declare void @use(i32)