Skip to content

Commit e122e05

Browse files
authored
Fully outline all GlobalRefs (JuliaLang#56746)
This is an alternative to JuliaLang#56714 that goes in the opposite direction - just outline all GlobalRefs during lowering. It is a lot simpler that JuliaLang#56714 at the cost of some size increase. Numbers: sys.so .ldata size: This PR: 159.8 MB Master: 158.9 MB I don't have numbers of JuliaLang#56714, because it's not fully complete. Additionally, it's possible that restricting GlobalRefs from arguments position would let us use a more efficient encoding in the future.
1 parent 2c35132 commit e122e05

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/inference.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3031,14 +3031,13 @@ end
30313031

30323032
# issue #28279
30333033
# ensure that lowering doesn't move these into statement position, which would require renumbering
3034-
using Base: +, -
3035-
function f28279(b::Bool)
3034+
@eval function f28279(b::Bool)
30363035
let i = 1
3037-
while i > b
3038-
i -= 1
3036+
while $(>)(i, b)
3037+
i = $(-)(i, 1)
30393038
end
30403039
if b end
3041-
return i + 1
3040+
return $(+)(i, 1)
30423041
end
30433042
end
30443043
code28279 = code_lowered(f28279, (Bool,))[1].code

0 commit comments

Comments
 (0)