mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Fold single use token factor nodes into other token factor nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19701 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ec39a45bdb
commit
1e81b9e511
@ -264,8 +264,16 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
std::vector<SDOperand> Ops;
|
||||
bool Changed = false;
|
||||
for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i) {
|
||||
Ops.push_back(LegalizeOp(Node->getOperand(i))); // Legalize the operands
|
||||
Changed |= Ops[i] != Node->getOperand(i);
|
||||
SDOperand Op = Node->getOperand(i);
|
||||
// Fold single-use TokenFactor nodes into this token factor as we go.
|
||||
if (Op.getOpcode() == ISD::TokenFactor && Op.hasOneUse()) {
|
||||
Changed = true;
|
||||
for (unsigned j = 0, e = Op.getNumOperands(); j != e; ++j)
|
||||
Ops.push_back(LegalizeOp(Op.getOperand(j)));
|
||||
} else {
|
||||
Ops.push_back(LegalizeOp(Op)); // Legalize the operands
|
||||
Changed |= Ops[i] != Op;
|
||||
}
|
||||
}
|
||||
if (Changed)
|
||||
Result = DAG.getNode(ISD::TokenFactor, MVT::Other, Ops);
|
||||
|
Loading…
x
Reference in New Issue
Block a user