[mlir][llvm] Opaque pointer support for atomic and call ops.
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Wed, 1 Feb 2023 09:08:42 +0000 (10:08 +0100)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Wed, 1 Feb 2023 09:08:52 +0000 (10:08 +0100)
commitd8153ae29959e8e27a1458fab4107e93b5861240
tree776a03583dceef3b050014e00b95db72ba9f2e2d
parent1ac248e485c2ee88fcaf1694942b599ea987a726
[mlir][llvm] Opaque pointer support for atomic and call ops.

This revision adapts the printers and parsers of the LLVM Dialect
AtomicRMWOp, AtomicCmpXchgOp, CallOp, and InvokeOp to support both
opaque and typed pointers by printing the pointer types explicitly.
Previously, the printers and parser of these operations silently assumed
typed pointers. This assumption is problematic if a lowering or the
LLVM IR import produce LLVM Dialect with opaque pointers and the IR is
then printed and parsed, for example, when running mlir-translate. In
LLVM IR itself all tests with typed pointers are already gone. It is
thus important to start switching to opaque pointers.

This revision can be seen as a preparation step for the switch of the
LLVM Dialect to opaque pointers. Once printing and parsing works
seamlessly, all lowerings to LLVM Dialect can be switched to produce
opaque pointers. After a transition period, LLVM Dialect itself can by
simplified to support opaque pointers only.

Reviewed By: ftynse, Dinistro

Differential Revision: https://reviews.llvm.org/D142884
13 files changed:
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
mlir/test/Conversion/FuncToLLVM/convert-funcs.mlir
mlir/test/Conversion/MemRefToLLVM/memref-to-llvm.mlir
mlir/test/Dialect/LLVMIR/invalid.mlir
mlir/test/Dialect/LLVMIR/roundtrip.mlir
mlir/test/Dialect/OpenMP/invalid.mlir
mlir/test/Dialect/OpenMP/ops.mlir
mlir/test/Target/LLVMIR/Import/constant.ll
mlir/test/Target/LLVMIR/Import/instructions.ll
mlir/test/Target/LLVMIR/llvmir.mlir
mlir/test/Target/LLVMIR/openmp-reduction.mlir