[flang-commits] [flang] [flang][NFCI]Use config structure for MLIR to LLVM pass creation (PR #67792)

Mats Petersson via flang-commits flang-commits at lists.llvm.org
Mon Oct 2 06:23:25 PDT 2023


================
@@ -18,6 +18,21 @@
 
 #include "mlir/Dialect/OpenMP/OpenMPDialect.h"
 #include "mlir/IR/BuiltinOps.h"
+#include "llvm/Frontend/Debug/Options.h"
+#include "llvm/Passes/OptimizationLevel.h"
+
+/// Configuriation for the MLIR to LLVM pass pipeline.
+struct MLIRToLLVMPassPipelineConfig {
+  explicit MLIRToLLVMPassPipelineConfig(llvm::OptimizationLevel level) {
+    OptLevel = level;
+  }
+  llvm::OptimizationLevel OptLevel; ///< optimisation level
+  bool StackArrays = false; ///< convert memory allocations to alloca.
+  bool Underscoring = true; ///< add underscores to function names.
+  bool LoopVersioning = false; ///< Run the version loop pass.
+  llvm::codegenoptions::DebugInfoKind DebugInfo =
+      llvm::codegenoptions::NoDebugInfo; ///< Debug info generation.
+};
 
----------------
Leporacanthicus wrote:

That's a nice suggestion, but there's quite a lot of work to do that , and not something I think is worth doing right now. [and there's a whole load more fields in these options than we currently support in this structure].

https://github.com/llvm/llvm-project/pull/67792


More information about the flang-commits mailing list