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

avoid passing pointers for known Type arguments #35347

Merged
merged 1 commit into from
Apr 6, 2020

Conversation

JeffBezanson
Copy link
Member

As noticed in #34993.
Before:

julia> code_llvm(*, (Float16,Float16))

;  @ float.jl:398 within `*'
define i16 @"julia_*_66"(i16, i16) {
top:
  %2 = call float @j_Float32_67(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140254228698048 to %jl_value_t*) to %jl_value_t addrspace(10)*), i16 %0)
  %3 = call float @j_Float32_68(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140254228698048 to %jl_value_t*) to %jl_value_t addrspace(10)*), i16 %1)

After:

julia> code_llvm(*, (Float16,Float16))

;  @ float.jl:398 within `*'
define i16 @"julia_*_70"(i16, i16) {
top:
  %2 = call float @j_Float32_71(i16 %0)
  %3 = call float @j_Float32_72(i16 %1)

@JeffBezanson JeffBezanson added the compiler:codegen Generation of LLVM IR and native code label Apr 2, 2020
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a comment that this can be kept in sync with Core.Compiler.hasuniquerep?

@JeffBezanson JeffBezanson merged commit 755f479 into master Apr 6, 2020
@JeffBezanson JeffBezanson deleted the jb/consttypeargs branch April 6, 2020 19:06
ztultrebor pushed a commit to ztultrebor/julia that referenced this pull request Apr 17, 2020
maleadt added a commit to JuliaGPU/GPUCompiler.jl that referenced this pull request May 6, 2020
maleadt added a commit to JuliaGPU/GPUCompiler.jl that referenced this pull request May 6, 2020
maleadt added a commit to JuliaGPU/GPUCompiler.jl that referenced this pull request May 6, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants