Skip to content

Commit e080fca

Browse files
aviateskKristofferC
authored andcommitted
optimizer: fix various optimize_until misuses (#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. (cherry picked from commit e542818)
1 parent 4cf4269 commit e080fca

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

Compiler/src/optimize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ function run_passes_ipo_safe(
10301030
@pass "slot2reg" ir = slot2reg(ir, ci, sv)
10311031
# TODO: Domsorting can produce an updated domtree - no need to recompute here
10321032
@pass "compact 1" ir = compact!(ir)
1033-
@pass "Inlining" ir = ssa_inlining_pass!(ir, sv.inlining, ci.propagate_inbounds)
1033+
@pass "inlining" ir = ssa_inlining_pass!(ir, sv.inlining, ci.propagate_inbounds)
10341034
# @timeit "verify 2" verify_ir(ir)
10351035
@pass "compact 2" ir = compact!(ir)
10361036
@pass "SROA" ir = sroa_pass!(ir, sv.inlining)

Compiler/test/inline.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,7 +2217,7 @@ struct Issue52644
22172217
end
22182218
issue52644(::DataType) = :DataType
22192219
issue52644(::UnionAll) = :UnionAll
2220-
let ir = Base.code_ircode((Issue52644,); optimize_until="Inlining") do t
2220+
let ir = Base.code_ircode((Issue52644,); optimize_until="inlining") do t
22212221
issue52644(t.tuple)
22222222
end |> only |> first
22232223
ir.argtypes[1] = Tuple{}
@@ -2226,7 +2226,7 @@ let ir = Base.code_ircode((Issue52644,); optimize_until="Inlining") do t
22262226
@test irfunc(Issue52644(Tuple{<:Integer})) === :UnionAll
22272227
end
22282228
issue52644_single(x::DataType) = :DataType
2229-
let ir = Base.code_ircode((Issue52644,); optimize_until="Inlining") do t
2229+
let ir = Base.code_ircode((Issue52644,); optimize_until="inlining") do t
22302230
issue52644_single(t.tuple)
22312231
end |> only |> first
22322232
ir.argtypes[1] = Tuple{}

Compiler/test/irpasses.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ let # Test that CFG simplify doesn't try to merge every block in a loop into
920920
end
921921

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

Compiler/test/ssair.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ import .Compiler: NewInstruction, insert_node!
600600
let ir = Base.code_ircode((Int,Int); optimize_until="inlining") do a, b
601601
a^b
602602
end |> only |> first
603+
ir = Compiler.compact!(ir)
603604
nstmts = length(ir.stmts)
604605
invoke_idx = findfirst(@nospecialize(stmt)->Meta.isexpr(stmt, :invoke), ir.stmts.stmt)
605606
@test invoke !== nothing
@@ -661,6 +662,7 @@ end
661662
let ir = Base.code_ircode((Int,Int); optimize_until="inlining") do a, b
662663
a^b
663664
end |> only |> first
665+
ir = Compiler.compact!(ir)
664666
invoke_idx = findfirst(@nospecialize(stmt)->Meta.isexpr(stmt, :invoke), ir.stmts.stmt)
665667
@test invoke_idx !== nothing
666668
invoke_expr = ir.stmts.stmt[invoke_idx]

stdlib/InteractiveUtils/test/runtests.jl

Lines changed: 1 addition & 1 deletion
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)