1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Fix PR2850 and PR2863. Only generate movddup for 128-bit SSE vector shuffles.

llvm-svn: 57210
This commit is contained in:
Evan Cheng 2008-10-06 21:13:08 +00:00
parent 24ea5f2be7
commit 88d76ffe8a
2 changed files with 13 additions and 0 deletions

View File

@ -3954,6 +3954,7 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) {
// Canonicalize movddup shuffles.
if (V2IsUndef && Subtarget->hasSSE2() &&
VT.getSizeInBits() == 128 &&
X86::isMOVDDUPMask(PermMask.getNode()))
return CanonicalizeMovddup(Op, V1, PermMask, DAG, Subtarget->hasSSE3());

View File

@ -0,0 +1,12 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx,+sse2
; PR2850
@tmp_V2i = common global <2 x i32> zeroinitializer ; <<2 x i32>*> [#uses=2]
define void @f0() nounwind {
entry:
%0 = load <2 x i32>* @tmp_V2i, align 8 ; <<2 x i32>> [#uses=1]
%1 = shufflevector <2 x i32> %0, <2 x i32> undef, <2 x i32> zeroinitializer ; <<2 x i32>> [#uses=1]
store <2 x i32> %1, <2 x i32>* @tmp_V2i, align 8
ret void
}