diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2006-10-09 21:39:25 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2006-10-09 21:39:25 +0000 |
| commit | e646abb7b630c0c75ee7657bd7b5ecc78098d858 (patch) | |
| tree | e1c33e7aac00c7f181f059cfab9d293c7f5c30a2 /llvm/lib/Target | |
| parent | d90c2d7386b817dcb399a43c348726bca12b3a2d (diff) | |
| download | bcm5719-llvm-e646abb7b630c0c75ee7657bd7b5ecc78098d858.tar.gz bcm5719-llvm-e646abb7b630c0c75ee7657bd7b5ecc78098d858.zip | |
Don't convert to MOVLP if using shufps etc. may allow load folding.
llvm-svn: 30847
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 7abfc58d00d..f2f9385146c 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -3053,9 +3053,13 @@ static inline bool isScalarLoadToVector(SDNode *N) { /// V1 (and in order), and the upper half elements should come from the upper /// half of V2 (and in order). And since V1 will become the source of the /// MOVLP, it must be either a vector load or a scalar load to vector. -static bool ShouldXformToMOVLP(SDNode *V1, SDNode *Mask) { +static bool ShouldXformToMOVLP(SDNode *V1, SDNode *V2, SDNode *Mask) { if (!ISD::isNON_EXTLoad(V1) && !isScalarLoadToVector(V1)) return false; + // Is V2 is a vector load, don't do this transformation. We will try to use + // load folding shufps op. + if (ISD::isNON_EXTLoad(V2)) + return false; unsigned NumElems = Mask->getNumOperands(); if (NumElems != 2 && NumElems != 4) @@ -3497,7 +3501,7 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(SDOperand Op, SelectionDAG &DAG) { return Op; if (ShouldXformToMOVHLPS(PermMask.Val) || - ShouldXformToMOVLP(V1.Val, PermMask.Val)) + ShouldXformToMOVLP(V1.Val, V2.Val, PermMask.Val)) return CommuteVectorShuffle(Op, DAG); bool V1IsSplat = isSplatVector(V1.Val); |

