[PATCH] D72962: [MLIR, OpenMP] Translation of OpenMP barrier construct to LLVM IR

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 15:39:56 PST 2020


kiranchandramohan created this revision.
Herald added subscribers: llvm-commits, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini, guansong, mgorny.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: nicolasvasilache.
Herald added a project: LLVM.
kiranchandramohan retitled this revision from "Translation of OpenMP barrier construct to LLVM IR" to "[MLIR, OpenMP] Translation of OpenMP barrier construct to LLVM IR".
kiranchandramohan added a reviewer: ftynse.

This patch adds support for translation of the OpenMP barrier construct to LLVM IR. The OpenMP IRBuilder is used for this translation. A new flag (mlir-to-openmpllvmir) is added to invoke this translation.

A new file (ConvertToOpenMPLLVMIR.cpp) is added in lib/Target/LLVMIR. This file contains a ModuleTranslation class which inherits from the LLVM ModuleTranslation class. The class overrides the convertOperation function which is specialised for OpenMP operations. Couple of new functions postLLVMModuleCreation, postLLVMTranslation are added to get the llvmModule for creating an instance of the OpenMP IRBuilder.

The patch includes code changes and a testcase.

Note: This patch requires the under review patch (https://reviews.llvm.org/D72400) by @DavidTruby which adds the barrier construct to the OpenMP dialect.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72962

Files:
  mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
  mlir/include/mlir/Target/OpenMPLLVMIR.h
  mlir/lib/Target/CMakeLists.txt
  mlir/lib/Target/LLVMIR/ConvertToOpenMPLLVMIR.cpp
  mlir/test/Target/openmp-llvm.mlir
  mlir/tools/mlir-translate/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72962.238903.patch
Type: text/x-patch
Size: 7406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200117/abe6b3a0/attachment.bin>


More information about the llvm-commits mailing list