@@ -33,16 +33,6 @@ function scan_entry!(result::Vector{SlotInfo}, idx::Int, @nospecialize(stmt))
3333end
3434
3535
36- function lift_defuse (cfg:: CFG , defuse)
37- map (defuse) do slot
38- SlotInfo (
39- Int[block_for_inst (cfg, x) for x in slot. defs],
40- Int[block_for_inst (cfg, x) for x in slot. uses],
41- slot. any_newvar
42- )
43- end
44- end
45-
4636function scan_slot_def_use (nargs:: Int , ci:: CodeInfo , code:: Vector{Any} )
4737 nslots = length (ci. slotflags)
4838 result = SlotInfo[SlotInfo () for i = 1 : nslots]
@@ -523,7 +513,7 @@ function domsort_ssa!(ir::IRCode, domtree::DomTree)
523513 return new_ir
524514end
525515
526- function compute_live_ins (cfg:: CFG , defuse)
516+ function compute_live_ins (cfg:: CFG , defuse #= ::Union{SlotInfo,SSADefUse} =# )
527517 # We remove from `uses` any block where all uses are dominated
528518 # by a def. This prevents insertion of dead phi nodes at the top
529519 # of such a block if that block happens to be in a loop
@@ -585,8 +575,8 @@ function recompute_type(node::Union{PhiNode, PhiCNode}, ci::CodeInfo, ir::IRCode
585575 return new_typ
586576end
587577
588- function construct_ssa! (ci:: CodeInfo , ir:: IRCode , domtree:: DomTree , defuse, nargs :: Int ,
589- slottypes:: Vector{Any} )
578+ function construct_ssa! (ci:: CodeInfo , ir:: IRCode , domtree:: DomTree ,
579+ defuses :: Vector{SlotInfo} , nargs :: Int , slottypes:: Vector{Any} )
590580 code = ir. stmts. inst
591581 cfg = ir. cfg
592582 left = Int[]
@@ -615,7 +605,7 @@ function construct_ssa!(ci::CodeInfo, ir::IRCode, domtree::DomTree, defuse, narg
615605 for (_, exc) in catch_entry_blocks
616606 phicnodes[exc] = Vector {Tuple{SlotNumber, NewSSAValue, PhiCNode}} ()
617607 end
618- @timeit " idf" for (idx, slot) in Iterators. enumerate (defuse )
608+ @timeit " idf" for (idx, slot) in Iterators. enumerate (defuses )
619609 # No uses => no need for phi nodes
620610 isempty (slot. uses) && continue
621611 # TODO : Restore this optimization
@@ -670,9 +660,9 @@ function construct_ssa!(ci::CodeInfo, ir::IRCode, domtree::DomTree, defuse, narg
670660 end
671661 # Perform SSA renaming
672662 initial_incoming_vals = Any[
673- if 0 in defuse [x]. defs
663+ if 0 in defuses [x]. defs
674664 Argument (x)
675- elseif ! defuse [x]. any_newvar
665+ elseif ! defuses [x]. any_newvar
676666 undef_token
677667 else
678668 SSAValue (- 2 )
0 commit comments