[llvm] r286452 - [DAGCombiner] Show missed opportunity to UNDEF out-of-range SHL
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 10 06:19:45 PST 2016
Author: rksimon
Date: Thu Nov 10 08:19:45 2016
New Revision: 286452
URL: http://llvm.org/viewvc/llvm-project?rev=286452&view=rev
Log:
[DAGCombiner] Show missed opportunity to UNDEF out-of-range SHL
Fails to match constant shift value due to presence of AND mask.
Modified:
llvm/trunk/test/CodeGen/X86/combine-shl.ll
Modified: llvm/trunk/test/CodeGen/X86/combine-shl.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/combine-shl.ll?rev=286452&r1=286451&r2=286452&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/combine-shl.ll (original)
+++ llvm/trunk/test/CodeGen/X86/combine-shl.ll Thu Nov 10 08:19:45 2016
@@ -44,6 +44,21 @@ define <4 x i32> @combine_vec_shl_outofr
ret <4 x i32> %1
}
+define <4 x i32> @combine_vec_shl_outofrange2(<4 x i32> %a0) {
+; SSE-LABEL: combine_vec_shl_outofrange2:
+; SSE: # BB#0:
+; SSE-NEXT: xorps %xmm0, %xmm0
+; SSE-NEXT: retq
+;
+; AVX-LABEL: combine_vec_shl_outofrange2:
+; AVX: # BB#0:
+; AVX-NEXT: vxorps %xmm0, %xmm0, %xmm0
+; AVX-NEXT: retq
+ %1 = and <4 x i32> %a0, <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>
+ %2 = shl <4 x i32> %1, <i32 33, i32 33, i32 33, i32 33>
+ ret <4 x i32> %2
+}
+
; fold (shl x, 0) -> x
define <4 x i32> @combine_vec_shl_by_zero(<4 x i32> %x) {
; SSE-LABEL: combine_vec_shl_by_zero:
More information about the llvm-commits
mailing list