Commit 58e8a8d2 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by V8 LUCI CQ

Revert "[turboshaft] Print operator properties as custom data for turbolizer"

This reverts commit 6e0251f9.

Reason for revert: On suspicion of breaking node integration
https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20-%20node.js%20integration%20ng/21832/overview

Original change's description:
> [turboshaft] Print operator properties as custom data for turbolizer
>
> Bug: v8:12783
> Change-Id: Ie5812217b3e858d94174087fc492887b00dd2e9a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820581
> Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82401}

Bug: v8:12783
Change-Id: I3812a358c45e8e848ec1fb622a19d12f7aa6411b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3827664
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82407}
parent 6033866b
......@@ -2594,22 +2594,12 @@ struct PrintTurboshaftGraphPhase {
UnparkedScopeIfNeeded scope(data->broker());
AllowHandleDereference allow_deref;
{
TurboJsonFile json_of(data->info(), std::ios_base::app);
json_of << "{\"name\":\"" << phase
<< "\",\"type\":\"turboshaft_graph\",\"data\":"
<< AsJSON(data->turboshaft_graph(), data->node_origins(),
temp_zone)
<< "},\n";
}
PrintTurboshaftCustomDataPerOperation(
data->info(), "Properties", data->turboshaft_graph(),
[](std::ostream& stream, const turboshaft::Graph& graph,
turboshaft::OpIndex index) -> bool {
const auto& op = graph.Get(index);
op.PrintOptions(stream);
return true;
});
TurboJsonFile json_of(data->info(), std::ios_base::app);
json_of << "{\"name\":\"" << phase
<< "\",\"type\":\"turboshaft_graph\",\"data\":"
<< AsJSON(data->turboshaft_graph(), data->node_origins(),
temp_zone)
<< "},\n";
}
if (data->info()->trace_turbo_graph()) {
......
......@@ -37,7 +37,10 @@ void JSONTurboshaftGraphWriter::PrintNodes() {
os_ << "{\"id\":" << turboshaft_graph_.Index(op).id() << ",";
os_ << "\"title\":\"" << OpcodeName(op.opcode) << "\",";
os_ << "\"block_id\":" << block.index().id() << ",";
os_ << "\"op_properties_type\":\"" << op.properties() << "\"";
os_ << "\"op_properties_type\":\"" << op.properties() << "\",";
os_ << "\"properties\":\"";
op.PrintOptions(os_);
os_ << "\"";
if (origins_) {
NodeOrigin origin = origins_->GetNodeOrigin(index.id());
if (origin.IsKnown()) {
......@@ -94,25 +97,4 @@ std::ostream& operator<<(std::ostream& os, const TurboshaftGraphAsJSON& ad) {
return os;
}
void PrintTurboshaftCustomDataPerOperation(
OptimizedCompilationInfo* info, const char* data_name, const Graph& graph,
std::function<bool(std::ostream&, const Graph&, OpIndex)> printer) {
DCHECK(printer);
TurboJsonFile json_of(info, std::ios_base::app);
json_of << "{\"name\":\"" << data_name
<< "\", \"type\":\"turboshaft_custom_data\", "
"\"data_target\":\"operations\", \"data\":[";
bool first = true;
for (auto index : graph.AllOperationIndices()) {
std::stringstream stream;
if (printer(stream, graph, index)) {
json_of << (first ? "\n" : ",\n") << "{\"key\":" << index.id()
<< ", \"value\":\"" << stream.str() << "\"}";
first = false;
}
}
json_of << "]},\n";
}
} // namespace v8::internal::compiler::turboshaft
......@@ -48,10 +48,6 @@ class JSONTurboshaftGraphWriter {
NodeOriginTable* origins_;
};
void PrintTurboshaftCustomDataPerOperation(
OptimizedCompilationInfo* info, const char* data_name, const Graph& graph,
std::function<bool(std::ostream&, const Graph&, OpIndex)> printer);
} // namespace v8::internal::compiler::turboshaft
#endif // V8_COMPILER_TURBOSHAFT_GRAPH_VISUALIZER_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment