diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-03-19 05:46:04 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-03-19 05:46:04 +0000 |
| commit | eb5b2e705cea55fdc78ffb3634720738893897e5 (patch) | |
| tree | 13f0ddea3bb8179cd707120723e444e385da9ce1 /llvm/lib/CodeGen | |
| parent | 0c9eb670bb1c46bc715fb1ab11a0ff490dd35621 (diff) | |
| download | bcm5719-llvm-eb5b2e705cea55fdc78ffb3634720738893897e5.tar.gz bcm5719-llvm-eb5b2e705cea55fdc78ffb3634720738893897e5.zip | |
Don't bother storing undef elements of BUILD_VECTOR's
llvm-svn: 26858
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index a0c10a09f72..d594cfe7efa 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -794,6 +794,9 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { unsigned VectorSize = MVT::getSizeInBits(VT)/8; // Store (in the right endianness) the elements to memory. for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i) { + // Ignore undef elements. + if (Node->getOperand(i).getOpcode() == ISD::UNDEF) continue; + unsigned Offset; if (isLittleEndian) Offset = TypeByteSize*i; @@ -807,7 +810,12 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { Node->getOperand(i), Idx, DAG.getSrcValue(NULL))); } - SDOperand StoreChain = DAG.getNode(ISD::TokenFactor, MVT::Other, Stores); + + SDOperand StoreChain; + if (!Stores.empty()) // Not all undef elements? + StoreChain = DAG.getNode(ISD::TokenFactor, MVT::Other, Stores); + else + StoreChain = DAG.getEntryNode(); // Result is a load from the stack slot. Result = DAG.getLoad(VT, StoreChain, FIPtr, DAG.getSrcValue(0)); |

