Skip to content

Commit b2c5372

Browse files
committed
Remove nonscalar setindex from the new optimizer
1 parent dba0929 commit b2c5372

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

base/compiler/optimize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ function isinlineable(m::Method, src::CodeInfo, mod::Module, params::Params, bon
263263
return inlineable
264264
end
265265

266-
const enable_new_optimizer = RefValue(false)
266+
const enable_new_optimizer = RefValue(true)
267267

268268
# converge the optimization work
269269
function optimize(me::InferenceState)

base/compiler/ssair/inlining2.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ function batch_inline!(todo, ir, domtree, linetable, sv)
3232

3333
if first_bb != block
3434
new_range = first_bb+1:block
35-
bb_rename[new_range] = (1:length(new_range)) .+ length(new_cfg_blocks)
35+
for (offset, idx) in pairs(new_range)
36+
bb_rename[idx] = offset + length(new_cfg_blocks)
37+
end
3638
append!(new_cfg_blocks, map(copy, ir.cfg.blocks[new_range]))
3739
push!(merged_orig_blocks, last(new_range))
3840
end
@@ -106,7 +108,9 @@ function batch_inline!(todo, ir, domtree, linetable, sv)
106108
end
107109
end
108110
new_range = first_bb+1:length(ir.cfg.blocks)
109-
bb_rename[new_range] = (1:length(new_range)) .+ length(new_cfg_blocks)
111+
for (offset, idx) in pairs(new_range)
112+
bb_rename[idx] = offset + length(new_cfg_blocks)
113+
end
110114
append!(new_cfg_blocks, ir.cfg.blocks[new_range])
111115

112116
# Rename edges original bbs

base/compiler/ssair/ir.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,9 @@ function resize!(compact::IncrementalCompact, nnewnodes)
545545
resize!(compact.result_types, nnewnodes)
546546
resize!(compact.result_lines, nnewnodes)
547547
resize!(compact.used_ssas, nnewnodes)
548-
compact.used_ssas[(old_length+1):nnewnodes] = 0
548+
for i in (old_length+1):nnewnodes
549+
compact.used_ssas[i] = 0
550+
end
549551
nothing
550552
end
551553

base/compiler/ssair/slot2ssa.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ function domsort_ssa!(ir, domtree)
375375
end
376376
old_inst_range = ir.cfg.blocks[bb].stmts
377377
inst_range = (1:length(old_inst_range)) .+ bb_start_off
378-
inst_rename[old_inst_range] = Any[SSAValue(x) for x in inst_range]
379378
for (nidx, idx) in zip(inst_range, old_inst_range)
379+
inst_rename[idx] = SSAValue(nidx)
380380
stmt = ir.stmts[idx]
381381
if isa(stmt, PhiNode)
382382
result_stmts[nidx] = rename_phinode_edges(stmt, bb, result_order, bb_rename)

0 commit comments

Comments
 (0)