Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Unified Diff: src/compiler/graph-visualizer.cc

Issue 1846933002: [turbofan] Handle dead diamonds in scheduling and add a test. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/scheduler.cc » ('j') | src/compiler/scheduler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-visualizer.cc
diff --git a/src/compiler/graph-visualizer.cc b/src/compiler/graph-visualizer.cc
index 6a9e620d0bc8d2a71a58e5a040f735d9b04d0dcb..6493093dae6365a2ad02b0cc125cec9cce6046fb 100644
--- a/src/compiler/graph-visualizer.cc
+++ b/src/compiler/graph-visualizer.cc
@@ -612,6 +612,7 @@ std::ostream& operator<<(std::ostream& os, const AsRPO& ar) {
Zone local_zone;
ZoneVector<byte> state(ar.graph.NodeCount(), kUnvisited, &local_zone);
ZoneStack<Node*> stack(&local_zone);
+ ZoneVector<Node*> all(&local_zone);
stack.push(ar.graph.end());
state[ar.graph.end()->id()] = kOnStack;
@@ -627,6 +628,7 @@ std::ostream& operator<<(std::ostream& os, const AsRPO& ar) {
}
}
if (pop) {
+ all.push_back(n);
state[n->id()] = kVisited;
stack.pop();
os << "#" << n->id() << ":" << *n->op() << "(";
@@ -638,6 +640,29 @@ std::ostream& operator<<(std::ostream& os, const AsRPO& ar) {
os << ")" << std::endl;
}
}
+
+ bool first = true;
+
+ for (size_t i = 0; i < all.size(); i++) {
+ Node* l = all[i];
+ for (Node* n : l->uses()) {
+ if (state[n->id()] == kUnvisited) {
+ state[n->id()] = kVisited;
+ all.push_back(n);
+ if (first) {
+ os << "Gray nodes:" << std::endl;
+ first = false;
+ }
+ os << "#" << n->id() << ":" << *n->op() << "(";
+ int j = 0;
+ for (Node* const i : n->inputs()) {
+ if (j++ > 0) os << ", ";
+ os << "#" << SafeId(i) << ":" << SafeMnemonic(i);
+ }
+ os << ")" << std::endl;
+ }
+ }
+ }
return os;
}
} // namespace compiler
« no previous file with comments | « no previous file | src/compiler/scheduler.cc » ('j') | src/compiler/scheduler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698