-
-
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
Generated functions to allow return of Julia IR instead of julia AST #21146
Comments
You mean generated functions? You can just return a llvmcall. |
Here is the gist of what I want to be able to do. @generated function gf1(some_func, arg_type1, arg_type2, ..., arg_typeN)
optimized_ir = ParallelAccelerator.optimize(some_func, arg_type1, arg_type2, ..., arg_typeN)
return optimized_ir
end The problem is that ParallelAccelerator produces an optimized IR for some function for a given set of argument types and then we need to have a Julia method instance created from that IR. Currently, we do this in a really ugly way. We make a stub function and then replace the stub's IR with the optimized IR. This is very fragile and dependent on lots of internal moving parts of Julia. If a |
@DrTodd13 please quote code snippets and surround macros by backtics in other to avoid bringing accidentally unrelated people to the conversation. (I edited your post above, but consider this in the future) |
Still, why can't you just return a |
Yes, @vtjnash is correct. I want to return Julia IR, not LLVM IR. |
You mean lowered AST? |
No, in effect it is an optimized version of typed IR returned from code_typed. |
Implemented by #22440. |
Right now, generators can only return AST. It would help ParallelAccelerator if generators were also allowed to return IR.
The text was updated successfully, but these errors were encountered: