[llvm-commits] [llvm] r97165 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Dan Gohman gohman at apple.com
Thu Feb 25 12:30:49 PST 2010


Author: djg
Date: Thu Feb 25 14:30:49 2010
New Revision: 97165

URL: http://llvm.org/viewvc/llvm-project?rev=97165&view=rev
Log:
Fix ExpandVectorBuildThroughStack for the case where the
operands are themselves vectors. Based on a patch by
Micah Villmow for PR6338.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=97165&r1=97164&r2=97165&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Feb 25 14:30:49 2010
@@ -1539,7 +1539,6 @@
   // 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 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));





More information about the llvm-commits mailing list