Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to LoweredCodeUtils 2.4 #591

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ InteractiveUtils = "1.10"
JuliaInterpreter = "0.9"
Libdl = "1.10"
Logging = "1.10"
LoweredCodeUtils = "2.2 - 2.3" # TODO update to 2.4
LoweredCodeUtils = "2.4.4"
MacroTools = "0.5.6"
Pkg = "1.10"
PrecompileTools = "1"
Expand Down
48 changes: 22 additions & 26 deletions benchmark/Manifest.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/JET.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ using LoweredCodeUtils, JuliaInterpreter
using LoweredCodeUtils:
#=NamedVar,=# add_control_flow!, #=add_named_dependencies!, add_requests!,=#
add_ssa_preds!, add_typedefs!, callee_matches, find_typedefs, ismethod, istypedef,
print_with_code, pushall!, rng
print_with_code, pushall!, rng, strongly_connected_components

using JuliaInterpreter:
@lookup, _INACTIVE_EXCEPTION, bypass_builtins, collect_args, #=finish!,=#
Expand Down Expand Up @@ -327,8 +327,6 @@ include("abstractinterpret/typeinfer.jl")

function print_report end

include("toplevel/graph.jl")

const JULIA_SYNTAX_ENABLED = !(Base.get_bool_env("JULIA_USE_FLISP_PARSER", false))

include("toplevel/virtualprocess.jl")
Expand Down
115 changes: 0 additions & 115 deletions src/toplevel/graph.jl

This file was deleted.

14 changes: 8 additions & 6 deletions src/toplevel/virtualprocess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,9 @@ function select_dependencies!(concretize, src, edges)
# and thus the analysis here should terminate in reasonable time even with a fairly
# complex control flow graph
cfg = compute_basic_blocks(src.code)
domtree = LoweredCodeUtils.construct_domtree(cfg.blocks)
postdomtree = LoweredCodeUtils.construct_postdomtree(cfg.blocks)

loops = filter!(>(1)∘length, strongly_connected_components(cfg))

critical_blocks = BitSet()
Expand All @@ -1181,21 +1184,20 @@ function select_dependencies!(concretize, src, edges)
# push!(critical_blocks, minimum(loop) - 1)
end
end
# Mark the exit statement of each critical block
for i in critical_blocks
concretize[cfg.blocks[i].stmts[end]] = true
end

norequire = BitSet()
for (i, block) in enumerate(cfg.blocks)
if i ∉ critical_blocks
pushall!(norequire, rng(block))
end
end

changed = true
while changed
changed = false

# track SSA predecessors and control flows of the critical blocks
changed |= add_ssa_preds!(concretize, src, edges, norequire)
changed |= add_control_flow!(concretize, cfg, norequire)
changed |= add_control_flow!(concretize, cfg, domtree, postdomtree)
end
end

Expand Down
Loading