From 138ff14e89cd5d5e655470385747a56db0277f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Je=C4=8Dmen?= Date: Wed, 27 Apr 2022 13:59:43 +0000 Subject: [PATCH] only inline if dominating force has a framestate --- rir/src/compiler/opt/force_dominance.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rir/src/compiler/opt/force_dominance.cpp b/rir/src/compiler/opt/force_dominance.cpp index dcc0d4e9d..fe91e4dcc 100644 --- a/rir/src/compiler/opt/force_dominance.cpp +++ b/rir/src/compiler/opt/force_dominance.cpp @@ -192,7 +192,14 @@ bool ForceDominance::apply(Compiler&, ClosureVersion* cls, Code* code, Value* eager = mkarg->eagerArg(); f->replaceUsesWith(eager); next = bb->remove(ip); - } else if (toInline.count(f)) { + } else if (toInline.count(f) && + // Can't inline a promise with Assumes if the + // dominating Force doesn't have a Framestate + (f->frameState() || + Visitor::check(mkarg->prom()->entry, + [](Instruction* i) { + return !Assume::Cast(i); + }))) { anyChange = true; Promise* prom = mkarg->prom(); BB* split =