-
Notifications
You must be signed in to change notification settings - Fork 9
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
jl-generators.cpp
changes
#447
base: main
Are you sure you want to change the base?
Conversation
This is super cool!!!
My bad, the file should've been properly formatted in the first place 😅. I've done a quick review and this is clearly a strict improvement over what we had. |
@jumerckx I think so, an other interesting part can be to handle "struct" attr, the C part is not exposed for all dialect, so using parse can be doable here. I try to get rid of parsing and build attribute directly from data with not much success (anyway parse is probably not the heaviest operation atm), Do you have experience with attribute internals? I don't know if we want to do all the attribute change directly or doing enum/simple one firstly and "struct" one after. Do you have ideas here? |
When I wrote the original generator, I asked around on the MLIR discord and the conclusion was that this was impossible using the C API. |
Thank for the confirmation, my idea was to add a C API in |
Would a custom CAPI extension help with this? I imagine not but might be misunderstanding. What happens with attribute values that don't have a corresponding Julia type that can be used in the struct? Does it fallback to ::String fields in the struct then, or is this a case where a generic |
generic IR.Attribute in this case, an example of that with |
@jumerckx, sorry for the formatting.
I try to implement features in JuliaLLVM/TableGen.jl#1 in C++
I implement several ideas :
result_
toresult
result_layouts=nothing::Union{Attribute, Nothing}
doesn't constraintresult_layouts
so change to :result_layouts::Union{Attribute, Nothing} =nothing
EnumAttr
: using Attr parsing (MLIR doesn't expose methods in C to easily construct arbitrary attribute) and discriminant.conv