Skip to content

Commit

Permalink
Extract PiNode insertion code from #26969
Browse files Browse the repository at this point in the history
This is just the pinode insertion code from #26969, which together
with #27068, should hopefully cover the same benchmarks in a more
acceptable way.
  • Loading branch information
Keno committed May 11, 2018
1 parent 3b5e180 commit a65d8b4
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions base/compiler/ssair/inlining2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,22 @@ function ir_inline_unionsplit!(compact::IncrementalCompact, topmod::Module, idx:
insert_node_here!(compact, GotoIfNot(cond, next_cond_bb), Union{}, line)
bb = next_cond_bb - 1
finish_current_bb!(compact)
# Insert Pi nodes here
argexprs′ = argexprs
if !isa(case, ConstantCase)
argexprs′ = copy(argexprs)
for i = 2:length(metharg.parameters)
a, m = atype.parameters[i], metharg.parameters[i]
isa(argexprs[i], SSAValue) || continue
if !(a <: m)
argexprs′[i] = insert_node_here!(compact, PiNode(argexprs′[i], m),
m, line)
end
end
end
if isa(case, InliningTodo)
val = ir_inline_item!(compact, idx, argexprs, linetable, case, boundscheck, todo_bbs)
val = ir_inline_item!(compact, idx, argexprs, linetable, case, boundscheck, todo_bbs)
elseif isa(case, MethodInstance)
val = insert_node_here!(compact, Expr(:invoke, case, argexprs...), typ, line)
val = insert_node_here!(compact, Expr(:invoke, case, argexprs...), typ, line)
else
case = case::ConstantCase
val = case.val
Expand Down

0 comments on commit a65d8b4

Please sign in to comment.