Skip to content
forked from v8/v8

Commit

Permalink
[wasm][revec] Fix control level calculation of LoopExit node
Browse files Browse the repository at this point in the history
LoopExit node is directly connected to the Loop node. In a BFS search
this can make the control levels of the nodes after the loop smaller
than the control levels of nodes inside loop body. This CL fixes it
by ignoring this kind of edge.

Bug: v8:12716
Change-Id: I7920f52d409a017e3726349098c36b3be4f4361c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4837464
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Hao A Xu <hao.a.xu@intel.com>
Cr-Commit-Position: refs/heads/main@{#89779}
  • Loading branch information
how759 authored and V8 LUCI CQ committed Sep 5, 2023
1 parent d15ef84 commit b82a911
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/compiler/linear-scheduler.cc
Expand Up @@ -32,6 +32,9 @@ void LinearScheduler::ComputeControlLevel() {
for (Edge const edge : node->use_edges()) {
if (!NodeProperties::IsControlEdge(edge)) continue;
Node* use = edge.from();
if (use->opcode() == IrOpcode::kLoopExit &&
node->opcode() == IrOpcode::kLoop)
continue;
if (control_level_.find(use) == control_level_.end() &&
use->opcode() != IrOpcode::kEnd) {
SetControlLevel(use, level + 1);
Expand Down

0 comments on commit b82a911

Please sign in to comment.