Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions base/compiler/ssair/passes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2140,10 +2140,10 @@ function legalize_bb_drop_pred!(ir::IRCode, bb::BasicBlock, bbidx::Int, bbs::Vec
end
ir[last_fallthrough_term_ssa] = nothing
kill_edge!(bbs, last_fallthrough, terminator.dest)
elseif isa(terminator, EnterNode)
return false
elseif isa(terminator, GotoNode)
return true
elseif isterminator(terminator)
return false
end
# Hack, but effective. If we have a predecessor with a fall-through terminator, change the
# instruction numbering to merge the blocks now such that below processing will properly
Expand Down
4 changes: 2 additions & 2 deletions test/compiler/irpasses.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ let code = Any[
# Block 2
EnterNode(4),
# Block 3
Expr(:leave),
Expr(:leave, SSAValue(2)),
# Block 4
GotoNode(5),
# Block 5
Expand All @@ -1603,7 +1603,7 @@ let code = Any[
ir = make_ircode(code)
ir = Core.Compiler.cfg_simplify!(ir)
Core.Compiler.verify_ir(ir)
@test length(ir.cfg.blocks) == 4
@test length(ir.cfg.blocks) <= 5
end

# Test CFG simplify with single predecessor phi node
Expand Down