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 =