summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorNirav Dave <niravd@google.com>2018-03-23 01:22:39 +0000
committerNirav Dave <niravd@google.com>2018-03-23 01:22:39 +0000
commit5b3e8791b4fd9fd34642a41f9e7ddc07a6ff29a6 (patch)
tree24e1d610f319f124e1a0d37a90bac5061e3de9d0 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parentf040158de76a577773b252f746b0d069e13fa3ab (diff)
downloadbcm5719-llvm-5b3e8791b4fd9fd34642a41f9e7ddc07a6ff29a6.tar.gz
bcm5719-llvm-5b3e8791b4fd9fd34642a41f9e7ddc07a6ff29a6.zip
[DAG] Fix node id invalidation in Instruction Selection.
Invalidation should be bit negation. Add missing negation. llvm-svn: 328287
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index fcc1d8f4ed4..c5af7877d7b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1000,15 +1000,15 @@ void SelectionDAGISel::EnforceNodeIdInvariant(SDNode *Node) {
// NodeId with the equivalent node id which is invalid for topological
// pruning.
void SelectionDAGISel::InvalidateNodeId(SDNode *N) {
- int InvalidId = -N->getNodeId() + 1;
+ int InvalidId = -(N->getNodeId() + 1);
N->setNodeId(InvalidId);
}
// getUninvalidatedNodeId - get original uninvalidated node id.
int SelectionDAGISel::getUninvalidatedNodeId(SDNode *N) {
int Id = N->getNodeId();
- if (Id < 0)
- return -Id + 1;
+ if (Id < -1)
+ return -(Id + 1);
return Id;
}
OpenPOWER on IntegriCloud