[PATCH] D79177: [flang] Add the header file for the conversion of FIR(MLIR) to LLVM-IR dialect

Eric Schweitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 08:29:48 PDT 2020


schweitz created this revision.
schweitz added reviewers: jeanPerier, vjayathirtha-nv, sscalpone.
schweitz added a project: Flang.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, aartbik, rriddle.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.

This is the interface to the conversion pass that converts the FIR dialect (and standard dialects) of MLIR to the LLVM-IR dialect. The implementation of this bridge will be forthcoming in subsequent diffs.

The purpose of the code gen bridge is to take the IR, which will be expressed as a mix of higher-level Fortran constructs as expressed in the FIR dialect and the MLIR standard dialect, and convert the representation into the LLVM-IR dialect. At that point, the LLVM-IR dialect can be converted into LLVM IR (proper) by a standard MLIR pass.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79177

Files:
  flang/include/flang/Optimizer/CodeGen/CodeGen.h


Index: flang/include/flang/Optimizer/CodeGen/CodeGen.h
===================================================================
--- /dev/null
+++ flang/include/flang/Optimizer/CodeGen/CodeGen.h
@@ -0,0 +1,34 @@
+//===-- Optimizer/CodeGen/CodeGen.h -- code generation ----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef OPTIMIZER_CODEGEN_CODEGEN_H
+#define OPTIMIZER_CODEGEN_CODEGEN_H
+
+#include <memory>
+
+namespace llvm {
+class raw_ostream;
+}
+namespace mlir {
+class Pass;
+}
+
+namespace fir {
+
+struct NameUniquer;
+
+/// Convert FIR to the LLVM IR dialect
+std::unique_ptr<mlir::Pass> createFIRToLLVMPass(NameUniquer &uniquer);
+
+/// Convert the LLVM IR dialect to LLVM-IR proper
+std::unique_ptr<mlir::Pass>
+createLLVMDialectToLLVMPass(llvm::raw_ostream &output);
+
+} // namespace fir
+
+#endif // OPTIMIZER_CODEGEN_CODEGEN_H


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79177.261238.patch
Type: text/x-patch
Size: 1114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200430/e0004a3d/attachment.bin>


More information about the llvm-commits mailing list