Skip to content

Commit

Permalink
Bump to LoweredCodeUtils 2.4
Browse files Browse the repository at this point in the history
Control-flow analysis changed considerably  in LoweredCodeUtils 2.4
(xref JuliaDebug/LoweredCodeUtils.jl#87).
This updates to the new version. The overall trend is less
reliance on `norequire` as a way of blocking certain "bad"
statements, instead attempting to discover minimal statements
purely by their dependencies.
  • Loading branch information
timholy authored and aviatesk committed Jan 16, 2024
1 parent f40e2ff commit 533b4c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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"
MacroTools = "0.5.6"
Pkg = "1.10"
PrecompileTools = "1"
Expand Down
2 changes: 1 addition & 1 deletion src/JET.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ using Base.Experimental: @MethodTable, @overlay
using LoweredCodeUtils, JuliaInterpreter

using LoweredCodeUtils:
#=NamedVar,=# add_control_flow!, #=add_named_dependencies!, add_requests!,=#
#=NamedVar,=# add_control_flow!, enumerate_paths, #=add_named_dependencies!, add_requests!,=#
add_ssa_preds!, add_typedefs!, callee_matches, find_typedefs, ismethod, istypedef,
print_with_code, pushall!, rng

Expand Down
12 changes: 6 additions & 6 deletions src/toplevel/virtualprocess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1181,21 +1181,21 @@ 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
paths = enumerate_paths(cfg)

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, paths)
end
end

Expand Down

0 comments on commit 533b4c5

Please sign in to comment.