Skip to content

Commit

Permalink
Enable CFG transforms; turn DCE back on globally
Browse files Browse the repository at this point in the history
  • Loading branch information
yhls committed Aug 3, 2020
1 parent ff20764 commit 6a250c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions base/compiler/ssair/ir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ mutable struct IncrementalCompact
cfg_transforms_enabled::Bool
fold_constant_branches::Bool

function IncrementalCompact(code::IRCode, allow_cfg_transforms::Bool=false)
function IncrementalCompact(code::IRCode, allow_cfg_transforms::Bool=true)
# Sort by position with attach after nodes after regular ones
perm = my_sortperm(Int[let new_node = code.new_nodes.info[i]
(new_node.pos * 2 + Int(new_node.attach_after))
Expand Down Expand Up @@ -1416,7 +1416,7 @@ function complete(compact::IncrementalCompact)
return IRCode(compact.ir, compact.result, cfg, compact.new_new_nodes)
end

function compact!(code::IRCode, allow_cfg_transforms::Bool=false)
function compact!(code::IRCode, allow_cfg_transforms::Bool=true)
compact = IncrementalCompact(code, allow_cfg_transforms)
# Just run through the iterator without any processing
for _ in compact; end # _ isa Pair{Int, Any}
Expand Down
2 changes: 1 addition & 1 deletion test/compiler/inline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function f_ifelse(x)
return b ? x + 1 : x
end
# 2 for now because the compiler leaves a GotoNode around
@test_broken length(code_typed(f_ifelse, (String,))[1][1].code) <= 2
@test length(code_typed(f_ifelse, (String,))[1][1].code) <= 2

# Test that inlining of _apply properly hits the inference cache
@noinline cprop_inline_foo1() = (1, 1)
Expand Down

0 comments on commit 6a250c4

Please sign in to comment.