Skip to content

Commit 92d8e45

Browse files
tebbiCommit Bot
authored andcommitted
Revert "[turbofan] trim effect chain nodes when they have no side-effect"
This reverts commit e02f561. Reason for revert: Regresses compile time: chromium:803840 Original change's description: > [turbofan] trim effect chain nodes when they have no side-effect > > Bug: > Change-Id: Ic1b6dc6fcd8bfc4f0c3dbb101a38106aa3596a12 > Reviewed-on: https://chromium-review.googlesource.com/863886 > Commit-Queue: Tobias Tebbi <[email protected]> > Reviewed-by: Jaroslav Sevcik <[email protected]> > Cr-Commit-Position: refs/heads/master@{#50588} [email protected],[email protected] Change-Id: I631840ca3b79272108d5696e6dc68d671774e35c Bug: Reviewed-on: https://chromium-review.googlesource.com/883521 Commit-Queue: Tobias Tebbi <[email protected]> Reviewed-by: Tobias Tebbi <[email protected]> Cr-Commit-Position: refs/heads/master@{#50833}
1 parent 90e50cc commit 92d8e45

File tree

1 file changed

+1
-51
lines changed

1 file changed

+1
-51
lines changed

src/compiler/graph-trimmer.cc

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "src/compiler/graph-trimmer.h"
66

77
#include "src/compiler/graph.h"
8-
#include "src/compiler/node-properties.h"
98

109
namespace v8 {
1110
namespace internal {
@@ -19,64 +18,15 @@ GraphTrimmer::GraphTrimmer(Zone* zone, Graph* graph)
1918

2019
GraphTrimmer::~GraphTrimmer() {}
2120

22-
namespace {
23-
bool IsSideEffectFree(const Operator* op) {
24-
switch (op->opcode()) {
25-
case IrOpcode::kLoad:
26-
case IrOpcode::kLoadElement:
27-
case IrOpcode::kLoadField:
28-
case IrOpcode::kTypeGuard:
29-
return true;
30-
default:
31-
return false;
32-
}
33-
}
34-
} // namespace
3521

3622
void GraphTrimmer::TrimGraph() {
3723
// Mark end node as live.
3824
MarkAsLive(graph()->end());
3925
// Compute transitive closure of live nodes.
4026
for (size_t i = 0; i < live_.size(); ++i) {
4127
Node* const live = live_[i];
42-
for (Edge edge : live->input_edges()) {
43-
Node* input = edge.to();
44-
if (NodeProperties::IsEffectEdge(edge)) {
45-
while (IsSideEffectFree(input->op())) {
46-
// Side-effect free effect chain nodes can be removed from the effect
47-
// chain when only their effect output is used. So we ignore the
48-
// effect chain use when determining liveness.
49-
DCHECK_EQ(1, input->op()->EffectInputCount());
50-
input = NodeProperties::GetEffectInput(input);
51-
}
52-
}
53-
MarkAsLive(input);
54-
}
28+
for (Node* const input : live->inputs()) MarkAsLive(input);
5529
}
56-
57-
// Remove unused side-effect-free nodes from the effect chain.
58-
// These are exactly the nodes we skipped before and that don't have value
59-
// uses. This has to be done before we remove dead->live edges because we need
60-
// to read the effect predecessor from the dead effect chain node.
61-
for (Node* const live : live_) {
62-
DCHECK(IsLive(live));
63-
for (Edge edge : live->input_edges()) {
64-
Node* input = edge.to();
65-
if (NodeProperties::IsEffectEdge(edge)) {
66-
Node* new_input = input;
67-
while (!IsLive(new_input)) {
68-
DCHECK(IsSideEffectFree(new_input->op()));
69-
if (FLAG_trace_turbo_trimming) {
70-
OFStream os(stdout);
71-
os << "DeadEffectChainNode: " << *new_input << std::endl;
72-
}
73-
new_input = NodeProperties::GetEffectInput(new_input);
74-
}
75-
if (new_input != input) edge.UpdateTo(new_input);
76-
}
77-
}
78-
}
79-
8030
// Remove dead->live edges.
8131
for (Node* const live : live_) {
8232
DCHECK(IsLive(live));

0 commit comments

Comments
 (0)