Propagate DAG node ordering during type legalization and instruction selection

A node's ordering is only propagated during legalization if (a) the new node does
not have an ordering (is not a CSE'd node), or (b) the new node has an ordering
that is higher than the node being legalized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177465 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Holewinski
2013-03-20 00:10:32 +00:00
parent 580f9c85fd
commit d73dc544f5
7 changed files with 120 additions and 16 deletions

View File

@@ -785,8 +785,10 @@ void SelectionDAGISel::DoInstructionSelection() {
if (ResNode == Node || Node->getOpcode() == ISD::DELETED_NODE)
continue;
// Replace node.
if (ResNode)
if (ResNode) {
CurDAG->AssignOrdering(ResNode, CurDAG->GetOrdering(Node));
ReplaceUses(Node, ResNode);
}
// If after the replacement this node is not used any more,
// remove this dead node.