diff options
author | Dan Gohman <gohman@apple.com> | 2010-02-25 20:30:49 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-02-25 20:30:49 +0000 |
commit | 9949dd612c8100f7ea7e6daaa56e465f106dd0bd (patch) | |
tree | 7537ab8974d6d25389ac7bb81c9d891d72b493fa /lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
parent | 6341c5a4c4019d4ff2a06bd69d4425324d6a7f81 (diff) | |
download | external_llvm-9949dd612c8100f7ea7e6daaa56e465f106dd0bd.tar.gz external_llvm-9949dd612c8100f7ea7e6daaa56e465f106dd0bd.tar.bz2 external_llvm-9949dd612c8100f7ea7e6daaa56e465f106dd0bd.zip |
Fix ExpandVectorBuildThroughStack for the case where the
operands are themselves vectors. Based on a patch by
Micah Villmow for PR6338.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index e9321dad8c..e0c10f8805 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1539,7 +1539,6 @@ SDValue SelectionDAGLegalize::ExpandVectorBuildThroughStack(SDNode* Node) { // the result as a vector. // Create the stack frame object. EVT VT = Node->getValueType(0); - EVT OpVT = Node->getOperand(0).getValueType(); EVT EltVT = VT.getVectorElementType(); DebugLoc dl = Node->getDebugLoc(); SDValue FIPtr = DAG.CreateStackTemporary(VT); @@ -1559,8 +1558,9 @@ SDValue SelectionDAGLegalize::ExpandVectorBuildThroughStack(SDNode* Node) { SDValue Idx = DAG.getConstant(Offset, FIPtr.getValueType()); Idx = DAG.getNode(ISD::ADD, dl, FIPtr.getValueType(), FIPtr, Idx); - // If EltVT smaller than OpVT, only store the bits necessary. - if (!OpVT.isVector() && EltVT.bitsLT(OpVT)) { + // If the destination vector element type is narrower than the source + // element type, only store the bits necessary. + if (EltVT.bitsLT(Node->getOperand(i).getValueType().getScalarType())) { Stores.push_back(DAG.getTruncStore(DAG.getEntryNode(), dl, Node->getOperand(i), Idx, SV, Offset, EltVT, false, false, 0)); |