[mlir][Async] Add option to LLVM lowering to use opaque pointers
authorMarkus Böck <markus.boeck02@gmail.com>
Fri, 10 Feb 2023 11:35:49 +0000 (12:35 +0100)
committerMarkus Böck <markus.boeck02@gmail.com>
Fri, 10 Feb 2023 16:39:36 +0000 (17:39 +0100)
commit2ca46421f85a1f4acf0d0b56ee31d76ff99ae3a1
treecb32ed7c24af1b4d9625cac6b2542bf87cda760f
parent7da2d644e0398be39e188ea6eacab2a942e0fa7e
[mlir][Async] Add option to LLVM lowering to use opaque pointers

Part of https://discourse.llvm.org/t/rfc-switching-the-llvm-dialect-and-dialect-lowerings-to-opaque-pointers/68179

This patch adds the pass option 'use-opaque-pointers' to allow the dialect conversion from async to LLVM to create LLVM opaque pointers instead of typed pointers.
The gist of the changes boil down to having to propagate the choice of whether opaque or typed pointers should be used, to various helper functions that then either create typed pointers or opaque pointers.
This sadly creates a bit of a code duplication in comparison to other patches in this series, which I think is mostly unavoidable however, since a lot of the patterns in this lowering require the use of the AsyncTypeConverter, instead of the LLVMTypeConverter.

Besides that, the tests have been converter to opaque pointers with one file with typed pointer support having been created as regression tests.

Differential Revision: https://reviews.llvm.org/D143661
mlir/include/mlir/Conversion/Passes.td
mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp
mlir/test/Conversion/AsyncToLLVM/convert-coro-to-llvm.mlir
mlir/test/Conversion/AsyncToLLVM/convert-runtime-to-llvm.mlir
mlir/test/Conversion/AsyncToLLVM/convert-to-llvm.mlir
mlir/test/Conversion/AsyncToLLVM/typed-pointers.mlir [new file with mode: 0644]