summaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2014-06-22 17:21:37 +0000
committerFilipe Cabecinhas <me@filcab.net>2014-06-22 17:21:37 +0000
commit7798d5992aa8d1bdf96b1c8399d26b6d38a998b5 (patch)
tree8423e3de48d23bfbea2cb466cc28e14503e69d85 /lib/Target
parentfe755c57f8958726b367253d8fe0c8bfb3404351 (diff)
downloadllvm-7798d5992aa8d1bdf96b1c8399d26b6d38a998b5.tar.gz
llvm-7798d5992aa8d1bdf96b1c8399d26b6d38a998b5.tar.bz2
llvm-7798d5992aa8d1bdf96b1c8399d26b6d38a998b5.tar.xz
Fix PR20087 by using the source index when changing the vector load
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211472 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index 5cabd14064..bc4168b20a 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -7805,12 +7805,13 @@ static SDValue getINSERTPS(ShuffleVectorSDNode *SVOp, SDLoc &dl,
std::find_if(Mask.begin(), Mask.end(), FromV2Predicate) - Mask.begin();
}
+ unsigned SrcIndex = Mask[DestIndex] % 4;
if (MayFoldLoad(From)) {
// Trivial case, when From comes from a load and is only used by the
// shuffle. Make it use insertps from the vector that we need from that
// load.
SDValue NewLoad =
- NarrowVectorLoadToElement(cast<LoadSDNode>(From), DestIndex, DAG);
+ NarrowVectorLoadToElement(cast<LoadSDNode>(From), SrcIndex, DAG);
if (!NewLoad.getNode())
return SDValue();
@@ -7831,7 +7832,6 @@ static SDValue getINSERTPS(ShuffleVectorSDNode *SVOp, SDLoc &dl,
}
// Vector-element-to-vector
- unsigned SrcIndex = Mask[DestIndex] % 4;
SDValue InsertpsMask = DAG.getIntPtrConstant(DestIndex << 4 | SrcIndex << 6);
return DAG.getNode(X86ISD::INSERTPS, dl, VT, To, From, InsertpsMask);
}