Skip to content

Commit

Permalink
[NewOptimizer] Union Split during Inlining
Browse files Browse the repository at this point in the history
This adds union splitting optimizations to the inliner.
This works a bit differently from the old optimizer, which
did union splitting on the bail out path. Instead, we try
to run the full inliner on any union split case that's a
dispatch tuple (and record what to do in that case). Doing
that allows an effective resolution of #23338, though this
PR doesn't quite do that yet, since some further (minor) fixes
are needed.
  • Loading branch information
Keno committed May 1, 2018
1 parent 23388ae commit ce70402
Show file tree
Hide file tree
Showing 7 changed files with 702 additions and 388 deletions.
9 changes: 0 additions & 9 deletions base/compiler/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,6 @@ using .Sort
# compiler #
############

inlining_enabled() = (JLOptions().can_inline == 1)
coverage_enabled() = (JLOptions().code_coverage != 0)
function inbounds_option()
opt_check_bounds = JLOptions().check_bounds
opt_check_bounds == 0 && return :default
opt_check_bounds == 1 && return :on
return :off
end

include("compiler/utilities.jl")
include("compiler/validation.jl")

Expand Down
2 changes: 2 additions & 0 deletions base/compiler/ssair/domtree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ function dominates(domtree::DomTree, bb1::Int, bb2::Int)
return bb1 == bb2
end

bb_unreachable(domtree::DomTree, bb::Int) = bb != 1 && domtree.nodes[bb].level == 1

function update_level!(domtree::Vector{DomTreeNode}, node::Int, level::Int)
domtree[node] = DomTreeNode(level, domtree[node].children)
foreach(domtree[node].children) do child
Expand Down
3 changes: 2 additions & 1 deletion base/compiler/ssair/driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ function run_passes(ci::CodeInfo, nargs::Int, linetable::Vector{LineInfoNode}, s
@timeit "compact 2" ir = compact!(ir)
@timeit "type lift" ir = type_lift_pass!(ir)
@timeit "compact 3" ir = compact!(ir)
#@timeit "verify 3" (verify_ir(ir); verify_linetable(linetable))
#@Base.show ir
@timeit "verify 3" (verify_ir(ir); verify_linetable(linetable))
return ir
end
Loading

0 comments on commit ce70402

Please sign in to comment.