Skip to content

Commit e542818

Browse files
authored
optimizer: fix various optimize_until misuses (JuliaLang#58035)
I fixed a bunch of places where the `optimize_until` path was specified incorrectly. Also, I changed `"Inlining"` to `"inlining"` to match the lowercase style of the other path names.
1 parent 9d00b57 commit e542818

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

Compiler/src/optimize.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ function run_passes_ipo_safe(
10441044
@pass "slot2reg" ir = slot2reg(ir, ci, sv)
10451045
# TODO: Domsorting can produce an updated domtree - no need to recompute here
10461046
@pass "compact 1" ir = compact!(ir)
1047-
@pass "Inlining" ir = ssa_inlining_pass!(ir, sv.inlining, ci.propagate_inbounds)
1047+
@pass "inlining" ir = ssa_inlining_pass!(ir, sv.inlining, ci.propagate_inbounds)
10481048
# @timeit "verify 2" verify_ir(ir)
10491049
@pass "compact 2" ir = compact!(ir)
10501050
@pass "SROA" ir = sroa_pass!(ir, sv.inlining)

Compiler/test/inline.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -2218,7 +2218,7 @@ struct Issue52644
22182218
end
22192219
issue52644(::DataType) = :DataType
22202220
issue52644(::UnionAll) = :UnionAll
2221-
let ir = Base.code_ircode((Issue52644,); optimize_until="Inlining") do t
2221+
let ir = Base.code_ircode((Issue52644,); optimize_until="inlining") do t
22222222
issue52644(t.tuple)
22232223
end |> only |> first
22242224
ir.argtypes[1] = Tuple{}
@@ -2227,7 +2227,7 @@ let ir = Base.code_ircode((Issue52644,); optimize_until="Inlining") do t
22272227
@test irfunc(Issue52644(Tuple{<:Integer})) === :UnionAll
22282228
end
22292229
issue52644_single(x::DataType) = :DataType
2230-
let ir = Base.code_ircode((Issue52644,); optimize_until="Inlining") do t
2230+
let ir = Base.code_ircode((Issue52644,); optimize_until="inlining") do t
22312231
issue52644_single(t.tuple)
22322232
end |> only |> first
22332233
ir.argtypes[1] = Tuple{}

Compiler/test/irpasses.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ let # Test that CFG simplify doesn't try to merge every block in a loop into
921921
end
922922

923923
# `cfg_simplify!` shouldn't error in a presence of `try/catch` block
924-
let ir = Base.code_ircode(; optimize_until="slot2ssa") do
924+
let ir = Base.code_ircode(; optimize_until="slot2reg") do
925925
v = try
926926
catch
927927
end

Compiler/test/ssair.jl

+2
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ import .Compiler: NewInstruction, insert_node!
601601
let ir = Base.code_ircode((Int,Int); optimize_until="inlining") do a, b
602602
a^b
603603
end |> only |> first
604+
ir = Compiler.compact!(ir)
604605
nstmts = length(ir.stmts)
605606
invoke_idx = findfirst(@nospecialize(stmt)->Meta.isexpr(stmt, :invoke), ir.stmts.stmt)
606607
@test invoke !== nothing
@@ -662,6 +663,7 @@ end
662663
let ir = Base.code_ircode((Int,Int); optimize_until="inlining") do a, b
663664
a^b
664665
end |> only |> first
666+
ir = Compiler.compact!(ir)
665667
invoke_idx = findfirst(@nospecialize(stmt)->Meta.isexpr(stmt, :invoke), ir.stmts.stmt)
666668
@test invoke_idx !== nothing
667669
invoke_expr = ir.stmts.stmt[invoke_idx]

stdlib/InteractiveUtils/test/runtests.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ end
826826
@test Base.infer_return_type(sin, (Int,)) == InteractiveUtils.@infer_return_type sin(42)
827827
@test Base.infer_exception_type(sin, (Int,)) == InteractiveUtils.@infer_exception_type sin(42)
828828
@test first(InteractiveUtils.@code_ircode sin(42)) isa Core.Compiler.IRCode
829-
@test first(InteractiveUtils.@code_ircode optimize_until="Inlining" sin(42)) isa Core.Compiler.IRCode
829+
@test first(InteractiveUtils.@code_ircode optimize_until="inlining" sin(42)) isa Core.Compiler.IRCode
830830

831831
@testset "Docstrings" begin
832832
@test isempty(Docs.undocumented_names(InteractiveUtils))

0 commit comments

Comments
 (0)