From 882cdfde516fb97a1fda1a3bbc85b1792aa7659c Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Mon, 6 Oct 2008 21:13:08 +0000 Subject: [PATCH] Fix PR2850 and PR2863. Only generate movddup for 128-bit SSE vector shuffles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57210 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 1 + test/CodeGen/X86/2008-10-06-MMXISelBug.ll | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 test/CodeGen/X86/2008-10-06-MMXISelBug.ll diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 494ac1d2795..d74588e6285 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -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()); diff --git a/test/CodeGen/X86/2008-10-06-MMXISelBug.ll b/test/CodeGen/X86/2008-10-06-MMXISelBug.ll new file mode 100644 index 00000000000..bd1ad59797a --- /dev/null +++ b/test/CodeGen/X86/2008-10-06-MMXISelBug.ll @@ -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 +} -- 2.34.1