Skip to content

Commit 441c570

Browse files
authored
Defensively copy IRCode from semi-concrete eval for inlining (#48963)
Currently, semi-concrete eval results are one-to-one associated with a particular callsite, so in theory we can destroy them during inlining and nothing bad will happen. However, since we propagate them using the `:info` field, this breaks the assumption that we can copy IRCode around and re-run the compiler on it without ill effect. In general, the `:info` field is assumed generally immutable and mutating the IR containted therein breaks all sorts of assumptions. Perhaps in the future, we can avoid destroying the IRCode that we're about to inline, which would make all this copying unnecessary (note that we're already copying for every case other than semi-concrete eval), but for now just fix the robustness issue here.
1 parent 369660f commit 441c570

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/compiler/ssair/inlining.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ function semiconcrete_result_item(result::SemiConcreteResult,
14751475
return compileable_specialization(mi, result.effects, et, info;
14761476
compilesig_invokes=OptimizationParams(state.interp).compilesig_invokes)
14771477
else
1478-
return InliningTodo(mi, result.ir, result.effects)
1478+
return InliningTodo(mi, retrieve_ir_for_inlining(mi, result.ir), result.effects)
14791479
end
14801480
end
14811481

0 commit comments

Comments
 (0)