@@ -352,8 +352,8 @@ function is_getfield_captures(@nospecialize(def), compact::IncrementalCompact)
352352end
353353
354354struct LiftedValue
355- x
356- LiftedValue (@nospecialize x ) = new (x )
355+ val
356+ LiftedValue (@nospecialize val ) = new (val )
357357end
358358const LiftedLeaves = IdDict{Any, Union{Nothing,LiftedValue}}
359359
@@ -578,7 +578,7 @@ function lift_comparison_leaves!(@specialize(tfunc),
578578 visited_phinodes, cmp, lifting_cache, Bool,
579579 lifted_leaves:: LiftedLeaves , val, nothing ):: LiftedValue
580580
581- compact[idx] = lifted_val. x
581+ compact[idx] = lifted_val. val
582582end
583583
584584struct LiftedPhi
@@ -626,7 +626,7 @@ function perform_lifting!(compact::IncrementalCompact,
626626 end
627627 end
628628
629- the_leaf_val = isa (the_leaf, LiftedValue) ? the_leaf. x : nothing
629+ the_leaf_val = isa (the_leaf, LiftedValue) ? the_leaf. val : nothing
630630 if ! isa (the_leaf_val, SSAValue)
631631 all_same = false
632632 end
@@ -690,7 +690,7 @@ function perform_lifting!(compact::IncrementalCompact,
690690 resize! (new_node. values, length (new_node. values)+ 1 )
691691 continue
692692 end
693- val = lifted_val. x
693+ val = lifted_val. val
694694 if isa (val, AnySSAValue)
695695 callback = (@nospecialize (pi ), @nospecialize (idx)) -> true
696696 val = simple_walk (compact, val, callback)
@@ -750,18 +750,18 @@ function lift_svec_ref!(compact::IncrementalCompact, idx::Int, stmt::Expr)
750750 elseif is_known_call (def, Core. _compute_sparams, compact)
751751 res = _lift_svec_ref (def, compact)
752752 if res != = nothing
753- compact[idx] = res
753+ compact[idx] = res. val
754754 end
755755 return
756756 end
757757 end
758758end
759759
760- function _lift_svec_ref (def :: Expr , compact :: IncrementalCompact )
761- # TODO : We could do the whole lifing machinery here, but really all
762- # we want to do is clean this up when it got inserted by inlining ,
763- # which always targets simple `svec` call or `_compute_sparams`,
764- # so this specialized lifting would be enough
760+ # TODO : We could do the whole lifing machinery here, but really all
761+ # we want to do is clean this up when it got inserted by inlining,
762+ # which always targets simple `svec` call or `_compute_sparams` ,
763+ # so this specialized lifting would be enough
764+ @inline function _lift_svec_ref (def :: Expr , compact :: IncrementalCompact )
765765 m = argextype (def. args[2 ], compact)
766766 isa (m, Const) || return nothing
767767 m = m. val
@@ -776,9 +776,13 @@ function _lift_svec_ref(def::Expr, compact::IncrementalCompact)
776776 sig. name === Tuple. name || return nothing
777777 length (sig. parameters) >= 1 || return nothing
778778
779- i = findfirst (j-> has_typevar (sig. parameters[j], tvar), 1 : length (sig. parameters))
779+ i = let sig= sig
780+ findfirst (j-> has_typevar (sig. parameters[j], tvar), 1 : length (sig. parameters))
781+ end
780782 i === nothing && return nothing
781- _any (j-> has_typevar (sig. parameters[j], tvar), i+ 1 : length (sig. parameters)) && return nothing
783+ let sig= sig
784+ any (j-> has_typevar (sig. parameters[j], tvar), i+ 1 : length (sig. parameters))
785+ end && return nothing
782786
783787 arg = sig. parameters[i]
784788 isa (arg, DataType) || return nothing
@@ -808,7 +812,7 @@ function _lift_svec_ref(def::Expr, compact::IncrementalCompact)
808812 length (applyTbody. parameters) == length (arg. parameters) == 1 || return nothing
809813 applyTbody. parameters[1 ] === applyTvar || return nothing
810814 arg. parameters[1 ] === tvar || return nothing
811- return argdef. args[3 ]
815+ return LiftedValue ( argdef. args[3 ])
812816end
813817
814818# NOTE we use `IdSet{Int}` instead of `BitSet` for in these passes since they work on IR after inlining,
@@ -1017,7 +1021,7 @@ function sroa_pass!(ir::IRCode, inlining::Union{Nothing, InliningState} = nothin
10171021 @assert val != = nothing
10181022 end
10191023
1020- compact[idx] = val === nothing ? nothing : val. x
1024+ compact[idx] = val === nothing ? nothing : val. val
10211025 end
10221026
10231027 non_dce_finish! (compact)
0 commit comments