-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make generated code for rational constructor and gcd slightly smaller #30036
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why does gcd have a GC frame? These look like they are supposed to lower to the same thing. |
I thought so too but alas: julia> @code_llvm gcd(2,3)
; Function gcd
; Location: intfuncs.jl:31
define i64 @julia_gcd_77333998(i64, i64) {
top:
%2 = alloca %jl_value_t addrspace(10)*, i32 3
%gcframe = alloca %jl_value_t addrspace(10)*, i32 4 julia> @code_typed gcd(2,3)
CodeInfo(
31 1 ── %1 = %new(Base.:(#throw1#305))::Const(#throw1#305(), false) │
32 │ %2 = (a === 0)::Bool │╻ ==
└─── goto #3 if not %2 │
2 ── %4 = (Base.flipsign_int)(b, b)::Int64 ││╻ flipsign A minimal example fails to reproduce though. |
Actually, the gcframe is not there in 1.0.1 but is there on mater. |
KristofferC
added a commit
that referenced
this pull request
Nov 19, 2018
(cherry picked from commit d70b797)
tkf
pushed a commit
to tkf/julia
that referenced
this pull request
Nov 21, 2018
KristofferC
added a commit
that referenced
this pull request
Dec 12, 2018
(cherry picked from commit d70b797)
KristofferC
added a commit
that referenced
this pull request
Feb 11, 2019
(cherry picked from commit d70b797)
KristofferC
added a commit
that referenced
this pull request
Feb 20, 2020
(cherry picked from commit d70b797)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rational
39 -> 15 SSA values in LLVM and no more GC frames.
Gcd
67 -> 45 SSA values in LLVM and no more GC frames.