[flang-commits] [flang] d93ae65 - [flang] Add the header file for the conversion of FIR(MLIR) to LLVM-IR dialect

Eric Schweitz via flang-commits flang-commits at lists.llvm.org
Thu Apr 30 11:45:57 PDT 2020


Author: Eric Schweitz
Date: 2020-04-30T11:45:39-07:00
New Revision: d93ae65253e07fd8e96224620840e1ed144dc81f

URL: https://github.com/llvm/llvm-project/commit/d93ae65253e07fd8e96224620840e1ed144dc81f
DIFF: https://github.com/llvm/llvm-project/commit/d93ae65253e07fd8e96224620840e1ed144dc81f.diff

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

Summary:
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.

Reviewers: jeanPerier, vjayathirtha-nv, sscalpone, jdoerfert, DavidTruby, kiranchandramohan

Reviewed By: sscalpone, kiranchandramohan

Tags: #llvm, #flang

Differential Revision: https://reviews.llvm.org/D79177

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

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Optimizer/CodeGen/CodeGen.h b/flang/include/flang/Optimizer/CodeGen/CodeGen.h
new file mode 100644
index 000000000000..9f6936e34e17
--- /dev/null
+++ b/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


        


More information about the flang-commits mailing list