mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:37:12 +00:00
VM: Don't rely on always running constant propagation in the optimizer
When inlining functions that unconditionally throw (have zero normal returns), the optimizer inserts a branch with a true condition and relies on constant propagation to remove the rest of the caller which becomes unreachable after inlining. This allows to compilesuch functions without running constant propagation by replacing uses of the return value with null. BUG= R=rmacnak@google.com Review URL: https://codereview.chromium.org/1419553005 .
This commit is contained in:
parent
e9171461fd
commit
05ad578b77
|
@ -548,6 +548,10 @@ void InlineExitCollector::ReplaceCall(TargetEntryInstr* callee_entry) {
|
|||
call_->previous()->AppendInstruction(branch);
|
||||
call_block->set_last_instruction(branch);
|
||||
|
||||
// Replace uses of the return value with null to maintain valid
|
||||
// SSA form - even though the rest of the caller is unreachable.
|
||||
call_->ReplaceUsesWith(caller_graph_->constant_null());
|
||||
|
||||
// Update dominator tree.
|
||||
call_block->AddDominatedBlock(callee_entry);
|
||||
call_block->AddDominatedBlock(false_block);
|
||||
|
|
Loading…
Reference in a new issue