]> granicus.if.org Git - llvm/commitdiff
[InstCombine] Add test cases for missing support for simplifying 1/X for vectors...
authorCraig Topper <craig.topper@gmail.com>
Mon, 17 Apr 2017 03:41:44 +0000 (03:41 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 17 Apr 2017 03:41:44 +0000 (03:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300438 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/div.ll

index 66ffa50dd62a70ed8a5eb27ff0461b6b741c739d..ab72f2cc5f506c8c652ebdb07c82d0cfe3be9b7b 100644 (file)
@@ -225,6 +225,15 @@ define i32 @test19(i32 %x) {
   ret i32 %A
 }
 
+define <2 x i32> @test19vec(<2 x i32> %x) {
+; CHECK-LABEL: @test19vec(
+; CHECK-NEXT:    [[A:%.*]] = udiv <2 x i32> <i32 1, i32 1>, [[X:%.*]]
+; CHECK-NEXT:    ret <2 x i32> [[A]]
+;
+  %A = udiv <2 x i32> <i32 1, i32 1>, %x
+  ret <2 x i32> %A
+}
+
 define i32 @test20(i32 %x) {
 ; CHECK-LABEL: @test20(
 ; CHECK-NEXT:    [[TMP1:%.*]] = add i32 %x, 1
@@ -236,6 +245,15 @@ define i32 @test20(i32 %x) {
   ret i32 %A
 }
 
+define <2 x i32> @test20vec(<2 x i32> %x) {
+; CHECK-LABEL: @test20vec(
+; CHECK-NEXT:    [[A:%.*]] = sdiv <2 x i32> <i32 1, i32 1>, [[X:%.*]]
+; CHECK-NEXT:    ret <2 x i32> [[A]]
+;
+  %A = sdiv <2 x i32> <i32 1, i32 1>, %x
+  ret <2 x i32> %A
+}
+
 define i32 @test21(i32 %a) {
 ; CHECK-LABEL: @test21(
 ; CHECK-NEXT:    [[DIV:%.*]] = sdiv i32 %a, 3