summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-05-20 20:55:17 +0000
committerSanjay Patel <spatel@rotateright.com>2016-05-20 20:55:17 +0000
commit54acedf88f8358a687c75db8352782554639cc63 (patch)
tree202778a399fa106ef3ff718cc68b18ce8c7862b8 /llvm
parent498f2fd11bae925e3097b705211621fb62933d93 (diff)
downloadbcm5719-llvm-54acedf88f8358a687c75db8352782554639cc63.tar.gz
bcm5719-llvm-54acedf88f8358a687c75db8352782554639cc63.zip
add tests for vector urem
llvm-svn: 270271
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/Transforms/InstCombine/rem.ll24
1 files changed, 23 insertions, 1 deletions
diff --git a/llvm/test/Transforms/InstCombine/rem.ll b/llvm/test/Transforms/InstCombine/rem.ll
index 0595a67393a..9f65228dee1 100644
--- a/llvm/test/Transforms/InstCombine/rem.ll
+++ b/llvm/test/Transforms/InstCombine/rem.ll
@@ -1,4 +1,4 @@
-; This test makes sure that urem instructions are properly eliminated.
+; This test makes sure that rem instructions are properly eliminated.
;
; RUN: opt < %s -instcombine -S | FileCheck %s
; END.
@@ -25,6 +25,28 @@ define i32 @test3(i32 %A) {
ret i32 %B
}
+; FIXME: This could be an 'and' just like above.
+
+define <2 x i32> @vec_power_of_2_constant_splat_divisor(<2 x i32> %A) {
+; CHECK-LABEL: @vec_power_of_2_constant_splat_divisor(
+; CHECK-NEXT: [[B:%.*]] = urem <2 x i32> %A, <i32 8, i32 8>
+; CHECK-NEXT: ret <2 x i32> [[B]]
+;
+ %B = urem <2 x i32> %A, <i32 8, i32 8>
+ ret <2 x i32> %B
+}
+
+; FIXME: And it shouldn't matter whether we have ConstantVector or ConstantDataVector.
+
+define <2 x i19> @weird_vec_power_of_2_constant_splat_divisor(<2 x i19> %A) {
+; CHECK-LABEL: @weird_vec_power_of_2_constant_splat_divisor(
+; CHECK-NEXT: [[B:%.*]] = urem <2 x i19> %A, <i19 8, i19 8>
+; CHECK-NEXT: ret <2 x i19> [[B]]
+;
+ %B = urem <2 x i19> %A, <i19 8, i19 8>
+ ret <2 x i19> %B
+}
+
define i1 @test3a(i32 %A) {
; CHECK-LABEL: @test3a(
; CHECK-NEXT: [[AND:%.*]] = and i32 %A, 7
OpenPOWER on IntegriCloud