Currently the use of bare pointer calling convention is controlled
globally through use of an option in the LLVMTypeConverter. To allow
more fine-grained control use an attribute on a function to drive the
calling convention to use.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@ftynse I just tried something that allows more fine-grained control on the use of bare pointer calling convention (as we discussed a couple of weeks ago). This is by no means meant to be the end state, rather looking for suggestions on how to take this forward.
This looks entirely reasonable to me as a start. The next step (potentially in a separate commit) could be to have the functionality that adds the attribute to all functions. With that in place, we can remove the current mechanism of forwarding the option in most places and just call that functionality before the main lowering happens.
mlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp | ||
---|---|---|
51 | I think there are use cases for GPU funcs with bare pointers, so it's better for this to support the attribute as well. |
mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp | ||
---|---|---|
66 | Duh!! |
mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp | ||
---|---|---|
279 | Ultra-nit: s/base/bare. |
Nit: I'd rather prefix this with llvm, this isn't something func dialect needs to be aware of.