summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-04-17 03:41:44 +0000
committerCraig Topper <craig.topper@gmail.com>2017-04-17 03:41:44 +0000
commiteee53c030a35bef75085a5a4070009ecedeaebbc (patch)
tree76910ccdcb3ab9c19a7952b1700358eb9b3cbdda
parent1a18a7c51e06f682223da2bab02e783acd5015cd (diff)
downloadbcm5719-llvm-eee53c030a35bef75085a5a4070009ecedeaebbc.tar.gz
bcm5719-llvm-eee53c030a35bef75085a5a4070009ecedeaebbc.zip
[InstCombine] Add test cases for missing support for simplifying 1/X for vectors. NFC
llvm-svn: 300438
-rw-r--r--llvm/test/Transforms/InstCombine/div.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/div.ll b/llvm/test/Transforms/InstCombine/div.ll
index 66ffa50dd62..ab72f2cc5f5 100644
--- a/llvm/test/Transforms/InstCombine/div.ll
+++ b/llvm/test/Transforms/InstCombine/div.ll
@@ -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
OpenPOWER on IntegriCloud