diff options
author | Justin Holewinski <jholewinski@nvidia.com> | 2013-03-20 14:51:01 +0000 |
---|---|---|
committer | Justin Holewinski <jholewinski@nvidia.com> | 2013-03-20 14:51:01 +0000 |
commit | fa963a885c074b3b0d6cc2466036297c476f7103 (patch) | |
tree | 4b1a32ec7ede3d92d950ceb996967dc646c6a70f /lib/CodeGen/SelectionDAG/SDNodeOrdering.h | |
parent | 06091513c283c863296f01cc7c2e86b56bb50d02 (diff) |
Move SDNode order propagation to SDNodeOrdering, which also fixes a missed
case of order propagation during isel.
Thanks Owen for the suggestion!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177525 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SDNodeOrdering.h')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SDNodeOrdering.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SDNodeOrdering.h b/lib/CodeGen/SelectionDAG/SDNodeOrdering.h index d2269f8acc..74010a8096 100644 --- a/lib/CodeGen/SelectionDAG/SDNodeOrdering.h +++ b/lib/CodeGen/SelectionDAG/SDNodeOrdering.h @@ -34,7 +34,9 @@ public: SDNodeOrdering() {} void add(const SDNode *Node, unsigned O) { - OrderMap[Node] = O; + unsigned OldOrder = getOrder(Node); + if (OldOrder == 0 || (OldOrder > 0 && O < OldOrder)) + OrderMap[Node] = O; } void remove(const SDNode *Node) { DenseMap<const SDNode*, unsigned>::iterator Itr = OrderMap.find(Node); |