-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
method cache prevents overspecialization of code_native #15456
Comments
Note this seems more restricted than #5560, since it seems like something that doesn't require iteration over type inference. |
I've corrected the issue title to reflect why the generated code looks like it does. In this particular case, the code generated is for: it look like we might need to recompute |
Ah, you mean that the "real" code is actually fine? |
|
We'll certainly want inlining here. Your analysis (thanks) led me to a workaround; let me know if you see any objections in #15578. |
inlining causes exponential code generation and linear data copies which causes excessive memory pressure and bad code locality. however, the compiler should be able to optimize the loop version of this in constant time (#15516 (comment)), in which case I think it might be feasible to define |
The cases I care about are where If there's a technically-better approach, I'm all for that. I've been hammering on Should I close #15578? |
This seems fixed |
Over at #15030, I'm trying to rewrite
ntuple(f, Val{N})
so that we don't need@generated
functions. It's not yet viable because, for this particular problem, codegen quality is poor. I think I've narrowed it down to a failure to substitute integer-valuedGenSym
s during codegen. Here's a lispy rewrite of that code that produces very simple lowered & typed code:Results:
Is there any chance this has an easy fix? Like, add a "substitute constant-valued GenSyms" pass during codegen?
The text was updated successfully, but these errors were encountered: