[mlir][GPU] Allow specifying alignment of memory attributions
Add support for argument attributes on workgroup and private attributions for GPU functions. These arguments are outside the range of getNumArguments() and get printed separately, so the default mechanism for function argument attributes can't be used on them. Having done this, check for the `llvm.align` attribute on workgroup or private attributions in a `gpu.func` and pass it through to the relevant allocation op (creating a global or alloca). This allows people creating kernels that use multiple workgroup buffers to set an alignment. (This could, in the future, be a GPU dialect `alignment` attribute, but I've taken the simpler route of using the LLVM version instead for simplicity and because I don't know how this might impact backends like Vulkan) Reviewed By: nirvedhmeshram Differential Revision: https://reviews.llvm.org/D148965
Loading
Please sign in to comment