@@ -674,7 +674,7 @@ its argument).
674674In a case when all usages are fully eliminated, `struct` allocation may also be erased as
675675a result of succeeding dead code elimination.
676676"""
677- function sroa_pass! (ir:: IRCode , nargs :: Int )
677+ function sroa_pass! (ir:: IRCode )
678678 compact = IncrementalCompact (ir)
679679 defuses = nothing # will be initialized once we encounter mutability in order to reduce dynamic allocations
680680 lifting_cache = IdDict {Pair{AnySSAValue, Any}, AnySSAValue} ()
@@ -846,18 +846,17 @@ function sroa_pass!(ir::IRCode, nargs::Int)
846846 used_ssas = copy (compact. used_ssas)
847847 simple_dce! (compact, (x:: SSAValue ) -> used_ssas[x. id] -= 1 )
848848 ir = complete (compact)
849- sroa_mutables! (ir, defuses, used_ssas, nargs )
849+ sroa_mutables! (ir, defuses, used_ssas)
850850 return ir
851851 else
852852 simple_dce! (compact)
853853 return complete (compact)
854854 end
855855end
856856
857- function sroa_mutables! (ir:: IRCode , defuses:: IdDict{Int, Tuple{SPCSet, SSADefUse}} , used_ssas:: Vector{Int} , nargs :: Int )
857+ function sroa_mutables! (ir:: IRCode , defuses:: IdDict{Int, Tuple{SPCSet, SSADefUse}} , used_ssas:: Vector{Int} )
858858 # initialization of domtree is delayed to avoid the expensive computation in many cases
859859 local domtree = nothing
860- estate = analyze_escapes (ir, nargs)
861860 for (idx, (intermediaries, defuse)) in defuses
862861 intermediaries = collect (intermediaries)
863862 # Check if there are any uses we did not account for. If so, the variable
@@ -933,7 +932,6 @@ function sroa_mutables!(ir::IRCode, defuses::IdDict{Int, Tuple{SPCSet, SSADefUse
933932 end
934933 end
935934 end
936- is_load_forwardable (estate[SSAValue (idx)]) || println (" [EA] bad EA: " , ir. argtypes[1 : nargs], " at " , idx)
937935 # Everything accounted for. Go field by field and perform idf:
938936 # Compute domtree now, needed below, now that we have finished compacting the IR.
939937 # This needs to be after we iterate through the IR with `IncrementalCompact`
@@ -992,11 +990,6 @@ function sroa_mutables!(ir::IRCode, defuses::IdDict{Int, Tuple{SPCSet, SSADefUse
992990 end
993991end
994992
995- function is_load_forwardable (x:: EscapeAnalysis.EscapeInfo )
996- AliasInfo = x. AliasInfo
997- return isa (AliasInfo, EscapeAnalysis. IndexableFields)
998- end
999-
1000993function form_new_preserves (origex:: Expr , intermediates:: Vector{Int} , new_preserves:: Vector{Any} )
1001994 newex = Expr (:foreigncall )
1002995 nccallargs = length (origex. args[3 ]:: SimpleVector )
0 commit comments