[llvm] r333779 - [InstCombine] add tests for broken shuffle transform (PR37648)
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 1 11:52:38 PDT 2018
Author: spatel
Date: Fri Jun 1 11:52:38 2018
New Revision: 333779
URL: http://llvm.org/viewvc/llvm-project?rev=333779&view=rev
Log:
[InstCombine] add tests for broken shuffle transform (PR37648)
Modified:
llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll
Modified: llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll?rev=333779&r1=333778&r2=333779&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll Fri Jun 1 11:52:38 2018
@@ -582,3 +582,26 @@ define <2 x i32*> @pr23113(<4 x i32*> %A
%1 = shufflevector <4 x i32*> %A, <4 x i32*> undef, <2 x i32> <i32 0, i32 1>
ret <2 x i32*> %1
}
+
+; FIXME: Unused lanes in the new binop should not kill the entire op.
+
+define <2 x i32> @PR37648(<2 x i32> %x) {
+; CHECK-LABEL: @PR37648(
+; CHECK-NEXT: ret <2 x i32> undef
+;
+ %splat = shufflevector <2 x i32> %x, <2 x i32> undef, <2 x i32> zeroinitializer
+ %r = urem <2 x i32> %splat, <i32 1, i32 1>
+ ret <2 x i32> %r
+}
+
+define <2 x float> @splat_first_fp(<2 x float> %x) {
+; CHECK-LABEL: @splat_first_fp(
+; CHECK-NEXT: [[TMP1:%.*]] = fadd <2 x float> [[X:%.*]], <float 1.000000e+00, float undef>
+; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x float> [[TMP1]], <2 x float> undef, <2 x i32> zeroinitializer
+; CHECK-NEXT: ret <2 x float> [[TMP2]]
+;
+ %splat = shufflevector <2 x float> %x, <2 x float> undef, <2 x i32> zeroinitializer
+ %r = fadd <2 x float> %splat, <float 1.0, float 1.0>
+ ret <2 x float> %r
+}
+
More information about the llvm-commits
mailing list