Skip to content
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
merged 1 commit into from
Nov 16, 2018

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Nov 14, 2018

Rational

39 -> 15 SSA values in LLVM and no more GC frames.

Gcd

67 -> 45 SSA values in LLVM and no more GC frames.

@vtjnash
Copy link
Member

vtjnash commented Nov 14, 2018

Why does gcd have a GC frame? These look like they are supposed to lower to the same thing.

@KristofferC
Copy link
Member Author

KristofferC commented Nov 14, 2018

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.

@KristofferC
Copy link
Member Author

KristofferC commented Nov 14, 2018

Actually, the gcframe is not there in 1.0.1 but is there on mater.

@kshyatt kshyatt added the compiler:codegen Generation of LLVM IR and native code label Nov 14, 2018
@KristofferC KristofferC merged commit d70b797 into master Nov 16, 2018
@martinholters martinholters deleted the kc/outlining branch November 16, 2018 18:18
KristofferC added a commit that referenced this pull request Nov 19, 2018
@KristofferC KristofferC mentioned this pull request Nov 19, 2018
61 tasks
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
@KristofferC KristofferC added performance Must go faster and removed backport pending 1.0 labels Dec 12, 2018
KristofferC added a commit that referenced this pull request Feb 11, 2019
KristofferC added a commit that referenced this pull request Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants