Skip to content

Commit f2a5fb9

Browse files
authored
tweak outdated test cases (#51994)
Now those concretized calls are DCE-ed even though they are inlineable. So we don't need to call e.g. `cfg_simplify!`.
1 parent 5eaad53 commit f2a5fb9

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

test/compiler/inline.jl

+5-15
Original file line numberDiff line numberDiff line change
@@ -1840,26 +1840,16 @@ end
18401840
# Test that inlining can still use nothrow information from concrete-eval
18411841
# even if the result itself is too big to be inlined, and nothrow is not
18421842
# known without concrete-eval
1843-
const THE_BIG_TUPLE = ntuple(identity, 1024)
1843+
const THE_BIG_TUPLE = ntuple(identity, 1024);
18441844
function return_the_big_tuple(err::Bool)
18451845
err && error("BAD")
18461846
return THE_BIG_TUPLE
18471847
end
1848-
@noinline function return_the_big_tuple_noinline(err::Bool)
1849-
err && error("BAD")
1850-
return THE_BIG_TUPLE
1848+
@test fully_eliminated() do
1849+
return_the_big_tuple(false)[1]
18511850
end
1852-
big_tuple_test1() = return_the_big_tuple(false)[1]
1853-
big_tuple_test2() = return_the_big_tuple_noinline(false)[1]
1854-
1855-
@test fully_eliminated(big_tuple_test2, Tuple{})
1856-
# Currently we don't run these cleanup passes, but let's make sure that
1857-
# if we did, inlining would be able to remove this
1858-
let ir = Base.code_ircode(big_tuple_test1, Tuple{})[1][1]
1859-
ir = Core.Compiler.compact!(ir, true)
1860-
ir = Core.Compiler.cfg_simplify!(ir)
1861-
ir = Core.Compiler.compact!(ir, true)
1862-
@test length(ir.stmts) == 1
1851+
@test fully_eliminated() do
1852+
@inline return_the_big_tuple(false)[1]
18631853
end
18641854

18651855
# inlineable but removable call should be eligible for DCE

0 commit comments

Comments
 (0)