Skip to content

Commit d75113a

Browse files
committed
reflection fixes
1 parent 09982a1 commit d75113a

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/ir/wrap.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ import ..IRTools: IR, Statement, TypedMeta, Meta, block!
8585

8686
function IRCode(meta::TypedMeta)
8787
opt = OptimizationState(meta.frame)
88+
Base.Meta.partially_inline!(meta.code.code, [], meta.method.sig, Any[opt.sp...], 0, 0, :propagate)
8889
ir = just_construct_ssa(meta.code, deepcopy(meta.code.code),
8990
Int(meta.method.nargs)-1, opt)
9091
return compact!(ir)

src/reflection/reflection.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function typed_meta(T; world = worldcounter(), optimize = false)
4545
frame = Core.Compiler.typeinf_code2(method, type_signature, sps, optimize, params)
4646
ci = frame.src
4747
ci.inferred = true
48+
ci.method_for_inference_limit_heuristics = method
4849
if ci.ssavaluetypes == 0 # constant return; IRCode doesn't like this
4950
ci.ssavaluetypes = Any[Any]
5051
end
@@ -77,6 +78,7 @@ function meta(T; world = worldcounter())
7778
sps = svec(map(untvar, sps)...)
7879
mi = Core.Compiler.code_for_method(method, type_signature, sps, world, false)
7980
ci = Base.isgenerated(mi) ? Core.Compiler.get_staged(mi) : Base.uncompressed_ast(mi)
81+
ci.method_for_inference_limit_heuristics = method
8082
Base.Meta.partially_inline!(ci.code, [], method.sig, Any[sps...], 0, 0, :propagate)
8183
Meta(method, ci, sps)
8284
end

0 commit comments

Comments
 (0)