Skip to content

Commit

Permalink
only inline if dominating force has a framestate
Browse files Browse the repository at this point in the history
  • Loading branch information
JanJecmen committed May 17, 2022
1 parent cd486a6 commit 138ff14
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rir/src/compiler/opt/force_dominance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 138ff14

Please sign in to comment.