mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-11 11:34:02 +00:00
Don't bother storing undef elements of BUILD_VECTOR's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26858 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a17409dfd6
commit
74881908fe
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user