[llvm] r270271 - add tests for vector urem
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri May 20 13:55:17 PDT 2016
Author: spatel
Date: Fri May 20 15:55:17 2016
New Revision: 270271
URL: http://llvm.org/viewvc/llvm-project?rev=270271&view=rev
Log:
add tests for vector urem
Modified:
llvm/trunk/test/Transforms/InstCombine/rem.ll
Modified: llvm/trunk/test/Transforms/InstCombine/rem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/rem.ll?rev=270271&r1=270270&r2=270271&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/rem.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/rem.ll Fri May 20 15:55:17 2016
@@ -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
More information about the llvm-commits
mailing list