Skip to content

Commit

Permalink
Fix Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Zentrik committed Aug 30, 2023
1 parent 90fa7d9 commit 0908759
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion base/compiler/ssair/domtree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -754,4 +754,4 @@ end
"""
function dominates(dfsnumbers::AbstractVector{DFSNumber}, bb1::BBNumber, bb2::BBNumber)
dfsnumbers[bb1].in <= dfsnumbers[bb2].in && dfsnumbers[bb2].out <= dfsnumbers[bb1].out
end
end
20 changes: 10 additions & 10 deletions base/compiler/ssair/passes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,7 @@ struct CongruenceClass
end

function perform_symbolic_evaluation(stmt::Expr, ssa_to_ssa)
# rename all SSAValues
# rename all SSAValues
# taken from renumber_ir_elements!
if stmt.head !== :enter && !is_meta_expr_head(stmt.head)

Expand Down Expand Up @@ -1984,20 +1984,20 @@ function gvn!(ir::IRCode)

while changed
changed = false

# Reverse Post Order traversal of dominator tree
for (blockidx, block) in enumerate(ir.cfg.blocks), i in block.stmts
if !(ir.stmts.stmt[i] isa Expr) & !(ir.stmts.stmt[i] isa PhiNode)
if !(ir.stmts.stmt[i] isa Expr) & !(ir.stmts.stmt[i] isa PhiNode)
ssa_to_ssa[i] = i
continue
end

stmt::Union{Expr, PhiNode} = ir.stmts.stmt[i]

# IR_FLAG_NOTHROW is necessary, can't exclude it otherwise inference tests start to fail for some reason
# tmerge_types_slow starts to return Any instead of the desired result.
total_flags = IR_FLAG_CONSISTENT | IR_FLAG_EFFECT_FREE | IR_FLAG_NOTHROW
if !(ir.stmts.flag[i] & total_flags == total_flags)
if !(ir.stmts.flag[i] & total_flags == total_flags)
ssa_to_ssa[i] = i
continue
end
Expand All @@ -2023,7 +2023,7 @@ function gvn!(ir::IRCode)
changed = true
end
end
# empty!(val_to_ssa; preserve_size=true)
# empty!(val_to_ssa; preserve_size=true)
empty!(val_to_ssa)
sizehint!(val_to_ssa, length(ir.stmts.stmt))
end
Expand All @@ -2034,12 +2034,12 @@ function gvn!(ir::IRCode)
for (blockidx, block) in enumerate(ir.cfg.blocks), i in block.stmts
if ssa_to_ssa[i] != 0 && ssa_to_ssa[i] != i
if congruence_classes === nothing
congruence_classes = IdDict{Int, Vector{CongruenceClass}}()
congruence_classes = IdDict{Int, Vector{CongruenceClass}}()
end
if !haskey(congruence_classes, ssa_to_ssa[i])
congruence_classes[ssa_to_ssa[i]] = [CongruenceClass(ssa_to_ssa[i], block_for_inst(ir, ssa_to_ssa[i]))]
end
push!(congruence_classes[ssa_to_ssa[i]], CongruenceClass(i, blockidx))
push!(congruence_classes[ssa_to_ssa[i]], CongruenceClass(i, blockidx))
end
end

Expand All @@ -2059,9 +2059,9 @@ function gvn!(ir::IRCode)
while !isempty(elimination_stack) && !dominates(dfsnumbers, last(elimination_stack).blockidx, blockidx)
pop!(elimination_stack)
end
if isempty(elimination_stack)
if isempty(elimination_stack)
push!(elimination_stack, CongruenceClass(ssa, blockidx))
elseif last(elimination_stack).ssa < ssa
elseif last(elimination_stack).ssa < ssa
ir.stmts.stmt[ssa] = SSAValue(last(elimination_stack).ssa)
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/compiler/EscapeAnalysis/EAUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import Core:
CodeInstance, MethodInstance, CodeInfo
import .CC:
InferenceResult, OptimizationState, IRCode, copy as cccopy,
@timeit, convert_to_ircode, slot2reg, compact!, ssa_inlining_pass!, gvn!,
@timeit, convert_to_ircode, slot2reg, compact!, ssa_inlining_pass!, gvn!,
sroa_pass!, adce_pass!, JLOptions, verify_ir, verify_linetable
import .EA: analyze_escapes, ArgEscapeCache, EscapeInfo, EscapeState, is_ipo_profitable

Expand Down
2 changes: 1 addition & 1 deletion test/compiler/irpasses.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1473,4 +1473,4 @@ let src = @eval Module() begin
end
@test nphi == 1
@test count(iscall((src, Base.add_int)), src.code) == 1
end
end

0 comments on commit 0908759

Please sign in to comment.