aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-10-09 21:39:25 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-10-09 21:39:25 +0000
commit23425f5c7430818b060227a88fa4a93456040a0b (patch)
tree0631df6bac7381e00ea43a025e9245b337bfc2ae /lib/Target/X86
parentdc4c38279f6bf3b001515e6723e7b6d79ed378b0 (diff)
downloadexternal_llvm-23425f5c7430818b060227a88fa4a93456040a0b.zip
external_llvm-23425f5c7430818b060227a88fa4a93456040a0b.tar.gz
external_llvm-23425f5c7430818b060227a88fa4a93456040a0b.tar.bz2
Don't convert to MOVLP if using shufps etc. may allow load folding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30847 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index 7abfc58..f2f9385 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/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);