-
-
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
Inefficient codegen for non-concrete varargs #34459
Labels
compiler:codegen
Generation of LLVM IR and native code
Comments
Looks like I ran into this already: #27929. I'll close that issue since this has much more information. |
maleadt
added a commit
that referenced
this issue
Jan 25, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following example generates bad code on recent Julia releases (including master):
Not passing a
Type{Int}
(or any other non-concrete argument), or getting rid of the varargs, results in the expected clean code.This doesn't look like an inference/specialization problem to me (i.e. not #34365):
Instead, we get the tuple from the specsig but non-concrete varargs code path here:
julia/src/codegen.cpp
Lines 6177 to 6202 in 0549bf1
This penalizes a lot of Cassette-based code, where splatting is used heavily for every function call (
overdub(ctx, args...)
) and we get plenty calls tojl_f_tuple
andjl_f_getfield
as soon as passing a non-concrete argument (as observed in JuliaGPU/CUDAnative.jl#334 where these calls break compilation).The text was updated successfully, but these errors were encountered: