Prefer movlhps over punpcklqdq, etc. in more cases.

llvm-svn: 56627
This commit is contained in:
Evan Cheng 2008-09-25 23:35:16 +00:00
parent 0c1b884df1
commit 9dbe45c000
2 changed files with 6 additions and 6 deletions

View File

@ -3942,17 +3942,17 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) {
else if (isIdentityMask(PermMask.getNode(), true))
return V2;
// Canonicalize movddup shuffles.
if (V2IsUndef && Subtarget->hasSSE2() &&
X86::isMOVDDUPMask(PermMask.getNode()))
return CanonicalizeMovddup(Op, V1, PermMask, DAG, Subtarget->hasSSE3());
if (isSplatMask(PermMask.getNode())) {
if (isMMX || NumElems < 4) return Op;
// Promote it to a v4{if}32 splat.
return PromoteSplat(Op, DAG, Subtarget->hasSSE2());
}
// Canonicalize movddup shuffles.
if (V2IsUndef && Subtarget->hasSSE2() &&
X86::isMOVDDUPMask(PermMask.getNode()))
return CanonicalizeMovddup(Op, V1, PermMask, DAG, Subtarget->hasSSE3());
// If the shuffle can be profitably rewritten as a narrower shuffle, then
// do it!
if (VT == MVT::v8i16 || VT == MVT::v16i8) {

View File

@ -1,5 +1,5 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep movd | count 1
; RUN: llvm-as < %s | llc -march=x86-64 | grep {punpcklqdq.*%xmm0, %xmm0}
; RUN: llvm-as < %s | llc -march=x86-64 | grep {movlhps.*%xmm0, %xmm0}
define <2 x i64> @test3(i64 %A) nounwind {
entry: