[vm/compiler] Stop ConstantPropagator phi join at NonConstant.

Short-circuit the per-predecessor Join loop in
ConstantPropagator::VisitPhi once the running join has reached top.

Measured on a naive 49 KLOC generated lexer with --huge_method_cutoff
gates lifted: AOT compile drops from ~21s to ~11s (about 47%).

Work towards https://github.com/dart-lang/sdk/issues/63230

TEST=ci

Change-Id: I3103253bdba93252d4b7abcb25819a52f75b2058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505402
Auto-Submit: Modestas Valauskas <valauskasmodestas@gmail.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This commit is contained in:
Modestas Valauskas
2026-05-26 00:56:04 -07:00
committed by dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent fb4752caaf
commit 0a2f2ceacf
@@ -395,6 +395,8 @@ void ConstantPropagator::VisitPhi(PhiInstr* instr) {
if (reachable_->Contains(
block->PredecessorAt(pred_idx)->preorder_number())) {
Join(&value, instr->InputAt(pred_idx)->definition()->constant_value());
// Once top is reached, further Joins cannot change the value.
if (IsNonConstant(value)) break;
}
}
SetValue(instr, value);