Commit 505cfdd8 authored by danno's avatar danno Committed by Commit bot

[csa] More conservative propagation of flag marking blocks needing frames

Specifically, don't propage "needs_frame" up through non-deferred -> deferred
block transitions where there are multiple edges from the non-deferred to
deferred code.

LOG=N
R=epertoso@chromium.org

Review-Url: https://codereview.chromium.org/2606893002
Cr-Commit-Position: refs/heads/master@{#41972}
parent be11812c
......@@ -114,13 +114,36 @@ bool FrameElider::PropagateIntoBlock(InstructionBlock* block) {
}
}
// Propagate towards start ("upwards") if there are successors and all of
// them need a frame.
for (RpoNumber& succ : block->successors()) {
if (!InstructionBlockAt(succ)->needs_frame()) return false;
// Propagate towards start ("upwards")
bool need_frame_successors = false;
if (block->SuccessorCount() == 1) {
// For single successors, propagate the needs_frame information.
need_frame_successors =
InstructionBlockAt(block->successors()[0])->needs_frame();
} else {
// For multiple successors, each successor must only have a single
// predecessor (because the graph is in edge-split form), so each successor
// can independently create/dismantle a frame if needed. Given this
// independent control, only propagate needs_frame if all non-deferred
// blocks need a frame.
for (RpoNumber& succ : block->successors()) {
InstructionBlock* successor_block = InstructionBlockAt(succ);
DCHECK_EQ(1, successor_block->PredecessorCount());
if (!successor_block->IsDeferred()) {
if (successor_block->needs_frame()) {
need_frame_successors = true;
} else {
return false;
}
}
}
}
if (need_frame_successors) {
block->mark_needs_frame();
return true;
} else {
return false;
}
block->mark_needs_frame();
return true;
}
......
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