diff options
author | Nirav Dave <niravd@google.com> | 2018-01-31 15:23:17 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2018-01-31 15:23:17 +0000 |
commit | c3a1e16db1fed06ba707a3f6173ffbd805db36c6 (patch) | |
tree | 68cd8f7d76c77ef4c65702c9b1bce36e879c194b /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 98f0021dd37d88bd6ff5b87caf3b01f0ebfb46a7 (diff) | |
download | bcm5719-llvm-c3a1e16db1fed06ba707a3f6173ffbd805db36c6.tar.gz bcm5719-llvm-c3a1e16db1fed06ba707a3f6173ffbd805db36c6.zip |
[DAG] Prevent NodeId pruning of TokenFactors in Instruction Selection.
Summary:
Instruction Selection preserves relative orders of all nodes save
TokenFactors which we treat specially. As a result Node Ids for
TokenFactors may violate the topological ordering and should not be
considered as valid pruning candidates in predecessor search.
Fixes PR35316.
Reviewers: RKSimon, hfinkel
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D42701
llvm-svn: 323880
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index e90ec20bcdb..b3a316b93b4 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2157,7 +2157,9 @@ static bool findNonImmUse(SDNode *Use, SDNode* Def, SDNode *ImmedUse, while (!WorkList.empty()) { Use = WorkList.back(); WorkList.pop_back(); - if (Use->getNodeId() < Def->getNodeId() && Use->getNodeId() != -1) + // NodeId topological order of TokenFactors is not guaranteed. Do not skip. + if (Use->getOpcode() != ISD::TokenFactor && + Use->getNodeId() < Def->getNodeId() && Use->getNodeId() != -1) continue; // Don't revisit nodes if we already scanned it and didn't fail, we know we |