diff --git a/Project.toml b/Project.toml index ef5bd8fdd..45b52c784 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/src/JET.jl b/src/JET.jl index 68591e8a3..41589d6a6 100644 --- a/src/JET.jl +++ b/src/JET.jl @@ -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 diff --git a/src/toplevel/virtualprocess.jl b/src/toplevel/virtualprocess.jl index 928b137e4..e96754d2d 100644 --- a/src/toplevel/virtualprocess.jl +++ b/src/toplevel/virtualprocess.jl @@ -1181,13 +1181,13 @@ 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 @@ -1195,7 +1195,7 @@ function select_dependencies!(concretize, src, edges) # 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