[MLIR][OpenMP] Added OMPIRBuilder support for Target Data directives
authorAkash Banerjee <Akash.Banerjee@amd.com>
Fri, 17 Mar 2023 12:40:29 +0000 (12:40 +0000)
committerAkash Banerjee <Akash.Banerjee@amd.com>
Mon, 20 Mar 2023 18:48:21 +0000 (18:48 +0000)
commit2d373e4dc7e97b0b2d7022d8d04e64834204187c
tree3ae8e2d13611e3acfbf7bbdc83596ad0ea458185
parent92416b63a57b74689abc175bcafd97b674ff9728
[MLIR][OpenMP] Added OMPIRBuilder support for Target Data directives

This patch adds OpenMP IRBuilder support for the Target Data directives to allow lowering to LLVM IR.

The mlir::Translation is responsible for generating supporting code for processing the map_operands through the processMapOperand function, and also generate code for the r>

The OMPIRBuilder is responsible for generating the begin and end mapper function calls.

Limitations:
        - use_device_ptr and use_device_addr clauses are NOT supported for Target Data operation.
        - nowait clauses are NOT supported for Target Enter and Exit Data operations.
        - Only LLVMPointerType is supported for map_operands.

Differential Revision: https://reviews.llvm.org/D142914
clang/lib/CodeGen/CGOpenMPRuntime.cpp
llvm/include/llvm/Frontend/OpenMP/OMPConstants.h
llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
mlir/include/mlir/Target/LLVMIR/Dialect/OpenMPCommon.h [new file with mode: 0644]
mlir/lib/Target/LLVMIR/CMakeLists.txt
mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp
mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
mlir/lib/Target/LLVMIR/Dialect/OpenMPCommon.cpp [new file with mode: 0644]
mlir/test/Target/LLVMIR/omptarget-llvm.mlir [new file with mode: 0644]