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

Unnecessary GC frame when the result is returned directly #15457

Closed
yuyichao opened this issue Mar 11, 2016 · 1 comment
Closed

Unnecessary GC frame when the result is returned directly #15457

yuyichao opened this issue Mar 11, 2016 · 1 comment
Labels
compiler:codegen Generation of LLVM IR and native code performance Must go faster regression Regression in behavior compared to a previous version

Comments

@yuyichao
Copy link
Contributor

On 0.4.3,

julia> f2() = ccall(:jl_get_cpu_name, Ref{ByteString}, ())
f2 (generic function with 1 method)

julia> @code_llvm f2()

define %jl_value_t* @julia_f2_21304() {
top:
  %0 = call %jl_value_t* inttoptr (i64 140514339702960 to %jl_value_t* ()*)()
  ret %jl_value_t* %0
}

On current master

julia> f2() = ccall(:jl_get_cpu_name, Ref{ByteString}, ())
f2 (generic function with 1 method)

julia> @code_llvm f2()

define %jl_value_t* @julia_f2_22854() #0 {
top:
  %0 = alloca [3 x %jl_value_t*], align 8
  %.sub = getelementptr inbounds [3 x %jl_value_t*], [3 x %jl_value_t*]* %0, i64 0, i64 0
  %1 = getelementptr [3 x %jl_value_t*], [3 x %jl_value_t*]* %0, i64 0, i64 2
  store %jl_value_t* null, %jl_value_t** %1, align 8
  %2 = bitcast [3 x %jl_value_t*]* %0 to i64*
  store i64 2, i64* %2, align 8
  %3 = getelementptr [3 x %jl_value_t*], [3 x %jl_value_t*]* %0, i64 0, i64 1
  %4 = load i64, i64* bitcast (%jl_value_t*** @jl_tls_states to i64*), align 8
  %5 = bitcast %jl_value_t** %3 to i64*
  store i64 %4, i64* %5, align 8
  store %jl_value_t** %.sub, %jl_value_t*** @jl_tls_states, align 8
  %6 = call %jl_value_t* inttoptr (i64 139747097742064 to %jl_value_t* ()*)()
  store %jl_value_t* %6, %jl_value_t** %1, align 8
  %7 = load i64, i64* %5, align 8
  store i64 %7, i64* bitcast (%jl_value_t*** @jl_tls_states to i64*), align 8
  ret %jl_value_t* %6
}
@yuyichao yuyichao added performance Must go faster regression Regression in behavior compared to a previous version compiler:codegen Generation of LLVM IR and native code labels Mar 11, 2016
@yuyichao
Copy link
Contributor Author

yuyichao commented Jun 9, 2016

Move to #15369

@yuyichao yuyichao closed this as completed Jun 9, 2016
yuyichao added a commit that referenced this issue Jul 9, 2016
yuyichao added a commit that referenced this issue Jul 9, 2016
yuyichao added a commit that referenced this issue Jul 10, 2016
yuyichao added a commit that referenced this issue Jul 11, 2016
yuyichao added a commit that referenced this issue Jul 12, 2016
yuyichao added a commit that referenced this issue Jul 12, 2016
yuyichao added a commit that referenced this issue Jul 12, 2016
yuyichao added a commit that referenced this issue Jul 14, 2016
yuyichao added a commit that referenced this issue Jul 16, 2016
mfasi pushed a commit to mfasi/julia that referenced this issue Sep 5, 2016
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 regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

1 participant