[PATCH] D117661: [flang][NFC] Move current inliner files in Dialect directory

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 19 04:53:28 PST 2022


clementval created this revision.
clementval added reviewers: jeanPerier, schweitz.
Herald added subscribers: mehdi_amini, mgorny.
Herald added a project: Flang.
clementval requested review of this revision.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.

This patch just move the files from the Transforms directory to
the Dialect directory.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117661

Files:
  flang/include/flang/Optimizer/Dialect/FIRDialect.h
  flang/include/flang/Optimizer/Transforms/Passes.h
  flang/lib/Optimizer/Dialect/CMakeLists.txt
  flang/lib/Optimizer/Dialect/Inliner.cpp
  flang/lib/Optimizer/Transforms/CMakeLists.txt
  flang/lib/Optimizer/Transforms/Inliner.cpp


Index: flang/lib/Optimizer/Transforms/CMakeLists.txt
===================================================================
--- flang/lib/Optimizer/Transforms/CMakeLists.txt
+++ flang/lib/Optimizer/Transforms/CMakeLists.txt
@@ -4,7 +4,6 @@
   AffineDemotion.cpp
   CharacterConversion.cpp
   ArrayValueCopy.cpp
-  Inliner.cpp
   ExternalNameConversion.cpp
   MemoryAllocation.cpp
   MemRefDataFlowOpt.cpp
Index: flang/lib/Optimizer/Dialect/Inliner.cpp
===================================================================
--- flang/lib/Optimizer/Dialect/Inliner.cpp
+++ flang/lib/Optimizer/Dialect/Inliner.cpp
@@ -7,9 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "flang/Optimizer/Dialect/FIRDialect.h"
-#include "flang/Optimizer/Dialect/FIROps.h"
-#include "flang/Optimizer/Transforms/Passes.h"
-#include "mlir/Transforms/Passes.h"
 #include "llvm/Support/CommandLine.h"
 
 static llvm::cl::opt<bool>
@@ -18,7 +15,11 @@
                        llvm::cl::init(false));
 
 /// Should we inline the callable `op` into region `reg`?
-bool fir::canLegallyInline(mlir::Operation *op, mlir::Region *reg,
-                           mlir::BlockAndValueMapping &map) {
+bool fir::canLegallyInline(mlir::Operation *, mlir::Region *, bool,
+                           mlir::BlockAndValueMapping &) {
+  return aggressivelyInline;
+}
+
+bool fir::canLegallyInline(mlir::Operation *, mlir::Operation *, bool) {
   return aggressivelyInline;
 }
Index: flang/lib/Optimizer/Dialect/CMakeLists.txt
===================================================================
--- flang/lib/Optimizer/Dialect/CMakeLists.txt
+++ flang/lib/Optimizer/Dialect/CMakeLists.txt
@@ -3,6 +3,7 @@
   FIRDialect.cpp
   FIROps.cpp
   FIRType.cpp
+  Inliner.cpp
 
   DEPENDS
   CanonicalizationPatternsIncGen
Index: flang/include/flang/Optimizer/Transforms/Passes.h
===================================================================
--- flang/include/flang/Optimizer/Transforms/Passes.h
+++ flang/include/flang/Optimizer/Transforms/Passes.h
@@ -36,10 +36,6 @@
 std::unique_ptr<mlir::Pass> createPromoteToAffinePass();
 std::unique_ptr<mlir::Pass> createMemoryAllocationPass();
 
-/// Support for inlining on FIR.
-bool canLegallyInline(mlir::Operation *op, mlir::Region *reg,
-                      mlir::BlockAndValueMapping &map);
-
 // declarative passes
 #define GEN_PASS_REGISTRATION
 #include "flang/Optimizer/Transforms/Passes.h.inc"
Index: flang/include/flang/Optimizer/Dialect/FIRDialect.h
===================================================================
--- flang/include/flang/Optimizer/Dialect/FIRDialect.h
+++ flang/include/flang/Optimizer/Dialect/FIRDialect.h
@@ -15,6 +15,10 @@
 
 #include "mlir/IR/Dialect.h"
 
+namespace mlir {
+class BlockAndValueMapping;
+} // namespace mlir
+
 namespace fir {
 
 /// FIR dialect
@@ -50,6 +54,11 @@
   static llvm::StringRef getDialectNamespace() { return "fircg"; }
 };
 
+/// Support for inlining on FIR.
+bool canLegallyInline(mlir::Operation *op, mlir::Region *reg, bool,
+                      mlir::BlockAndValueMapping &map);
+bool canLegallyInline(mlir::Operation *, mlir::Operation *, bool);
+
 } // namespace fir
 
 #endif // FORTRAN_OPTIMIZER_DIALECT_FIRDIALECT_H


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117661.401176.patch
Type: text/x-patch
Size: 3243 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220119/f94e9d53/attachment.bin>


More information about the llvm-commits mailing list