Skip to content

Commit 5352917

Browse files
topolarityKristofferC
authored andcommitted
Miscellaneous Meta.partially_inline! fixes (#56813)
This fixes up a couple of conspicuous problems I noticed when reviewing I'm unsure we should have accepted this pass in Base to begin with... It should at least be re-written to error on unexpected IR elements (instead of performing an invalid transform silently), but the real problem is that this pass is out-of-pipeline and so it doesn't run on most user code and we have much worse coverage compared to passes in the main Compiler. (cherry picked from commit c1db3a4)
1 parent e04f0e1 commit 5352917

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

base/meta.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,19 @@ function _partially_inline!(@nospecialize(x), slot_replacements::Vector{Any},
364364
x.edges .+= slot_offset
365365
return x
366366
end
367+
if isa(x, Core.UpsilonNode)
368+
if !isdefined(x, :val)
369+
return x
370+
end
371+
return Core.UpsilonNode(
372+
_partially_inline!(x.val, slot_replacements, type_signature, static_param_values,
373+
slot_offset, statement_offset, boundscheck),
374+
)
375+
end
376+
if isa(x, Core.PhiCNode)
377+
_partially_inline!(x.values, slot_replacements, type_signature, static_param_values,
378+
slot_offset, statement_offset, boundscheck)
379+
end
367380
if isa(x, Core.ReturnNode)
368381
# Unreachable doesn't have val defined
369382
if !isdefined(x, :val)

0 commit comments

Comments
 (0)