Add support for the bare pointer calling convention in the gpu-to-llvm
pass. This wasn't being exposed and is needed when GPU-compiled MLIR is
to be called with this convention.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Can you add a test for this?
mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp | ||
---|---|---|
720 | options.useBarePtrCallConv = hostBarePtrCallConv; ? |
Do we really need a test for this? bare pointer lowering for memrefs has its own tests. This pass is just a user, just like gpu-to-nvvm and gpu-to-rocdl, and it's expected to work. I can add a test though if something new is exercised or we want to anyway to test to ensure the functionality is there.
mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp | ||
---|---|---|
720 | Thanks, done. |
I wasn’t sure if the lowering is expected to after the signature of a gpu.func for example?
Seems reasonable to me, surprised that this didn't break before (did something break?), approved.
The gpu-to-llvm pass is applied to lower host-side IR: typically, builtin.module(gpu-to-llvm). gpu.func aren't even processed by it. The other revision I have is the one that adds that option for gpu-to-nvvm which is the one that lowers the signature for gpu.func. We need both of these changes.
https://reviews.llvm.org/D152480
gpu-to-nvvm never provided that option - the other revision I have adds it to gpu-to-nvvm (https://reviews.llvm.org/D152480). If we used the bare ptr lowering here and not in gpu-to-nvvm or vice versa, things would break. That said, I can update an integration test case there to use the bare ptr lowering that will exercise both of these changes.
options.useBarePtrCallConv = hostBarePtrCallConv; ?