[flang-commits] [flang] [flang] Refactor to remove .inc file containing shared code (PR #109874)
via flang-commits
flang-commits at lists.llvm.org
Tue Sep 24 15:31:30 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-driver
Author: Tarun Prabhu (tarunprabhu)
<details>
<summary>Changes</summary>
Remove flang/include/flang/Tools/CLOptions.inc - which was included as is in - several places. Move the code in it to header and source files which are used used in the "standard" way. Some minor cleanup such as removing trailing whitespace and excessive newlines and reordering entries alphabetically for files that were modified along the way. Update the documentation that referenced CLOptions.inc.
------------------------
Notes for reviewers:
This is in response to #<!-- -->102975 being reverted. The underlying issue was `flang/include/flang/Tools/CLOptions.inc` being included directly in several places. That file contains command-line options and function definitions which results in the duplicate definition errors if the file is included in more than one place in an executable/library.
IMO, including files containing code causes issues in the long run as it removes the ability to link against certain libraries. This PR moves the code in `CLOptions.inc` into `.h` and `.cpp` files which can then be included and linked in the "standard" way.
The contents of `CLOptions.inc` are split across two places since the contents include both command line options and functions to build FIR pass pipelines which don't seem like they should belong together anyway.
The command line options were moved to `Common/` since it seemed a "reasonable" place for them.
The FIR pass pipeline code was moved to a new `Passes` directory in `flang/lib/Optimizer`. It was not possible to put the code in, for instance, `Common/`, `Support/` or `Optimizer/Transforms/` because that resulted in circular dependencies. The name `Passes` was chosen because the code there is functionally similar to some code in `llvm/Passes`.
---
Patch is 48.92 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/109874.diff
15 Files Affected:
- (modified) flang/docs/FlangDriver.md (+1-1)
- (added) flang/include/flang/Common/CommandLineOpts.h (+60)
- (added) flang/include/flang/Optimizer/Passes/Pipelines.h (+128)
- (removed) flang/include/flang/Tools/CLOptions.inc (-438)
- (modified) flang/lib/Common/CMakeLists.txt (+3-2)
- (added) flang/lib/Common/CommandLineOpts.cpp (+67)
- (modified) flang/lib/Frontend/CMakeLists.txt (+1)
- (modified) flang/lib/Frontend/FrontendActions.cpp (+1-2)
- (modified) flang/lib/Optimizer/CMakeLists.txt (+3-2)
- (added) flang/lib/Optimizer/Passes/CMakeLists.txt (+21)
- (added) flang/lib/Optimizer/Passes/Pipelines.cpp (+330)
- (modified) flang/tools/bbc/CMakeLists.txt (+1)
- (modified) flang/tools/bbc/bbc.cpp (+2-1)
- (modified) flang/tools/tco/CMakeLists.txt (+2)
- (modified) flang/tools/tco/tco.cpp (+2-1)
``````````diff
diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md
index e1c11062125028..815c26a28dfdfa 100644
--- a/flang/docs/FlangDriver.md
+++ b/flang/docs/FlangDriver.md
@@ -521,7 +521,7 @@ e.g. during the semantic checks.
## FIR Optimizer Pass Pipeline Extension Points
The default FIR optimizer pass pipeline `createDefaultFIROptimizerPassPipeline`
-in `flang/include/flang/Tools/CLOptions.inc` contains extension point callback
+in `flang/lib/Optimizer/Passes/Pipelines.cpp` contains extension point callback
invocations `invokeFIROptEarlyEPCallbacks`, `invokeFIRInlinerCallback`, and
`invokeFIROptLastEPCallbacks` for Flang drivers to be able to insert additonal
passes at different points of the default pass pipeline. An example use of these
diff --git a/flang/include/flang/Common/CommandLineOpts.h b/flang/include/flang/Common/CommandLineOpts.h
new file mode 100644
index 00000000000000..72674b2b809c24
--- /dev/null
+++ b/flang/include/flang/Common/CommandLineOpts.h
@@ -0,0 +1,60 @@
+//===-- CommandLineOptions.h -- shared command line options -----*- 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
+//
+//===----------------------------------------------------------------------===//
+
+/// This file declares some shared command-line options that can be used when
+/// debugging the test tools.
+
+#ifndef FORTRAN_COMMON_COMMANDLINEOPTS_H
+#define FORTRAN_COMMON_COMMANDLINEOPTS_H
+
+#include "llvm/Frontend/Debug/Options.h"
+#include "llvm/Passes/OptimizationLevel.h"
+#include "llvm/Support/CommandLine.h"
+
+/// Shared option in tools to control whether dynamically sized array
+/// allocations should always be on the heap.
+extern llvm::cl::opt<bool> dynamicArrayStackToHeapAllocation;
+
+/// Shared option in tools to set a maximum value for the number of elements in
+/// a compile-time sized array that can be allocated on the stack.
+extern llvm::cl::opt<std::size_t> arrayStackAllocationThreshold;
+
+/// Shared option in tools to ignore missing runtime type descriptor objects
+/// when translating FIR to LLVM. The resulting program will crash if the
+/// runtime needs the derived type descriptors, this is only a debug option to
+/// allow compiling manually written FIR programs involving derived types
+/// without having to write the derived type descriptors which are normally
+/// generated by the frontend.
+extern llvm::cl::opt<bool> ignoreMissingTypeDescriptors;
+
+/// Default optimization level used to create Flang pass pipeline is O0.
+extern llvm::OptimizationLevel defaultOptLevel;
+
+extern llvm::codegenoptions::DebugInfoKind noDebugInfo;
+
+/// Optimizer Passes
+extern llvm::cl::opt<bool> disableCfgConversion;
+extern llvm::cl::opt<bool> disableFirAvc;
+extern llvm::cl::opt<bool> disableFirMao;
+
+extern llvm::cl::opt<bool> disableFirAliasTags;
+extern llvm::cl::opt<bool> useOldAliasTags;
+
+/// CodeGen Passes
+extern llvm::cl::opt<bool> disableCodeGenRewrite;
+extern llvm::cl::opt<bool> disableTargetRewrite;
+extern llvm::cl::opt<bool> disableDebugInfo;
+extern llvm::cl::opt<bool> disableFirToLlvmIr;
+extern llvm::cl::opt<bool> disableLlvmIrToLlvm;
+extern llvm::cl::opt<bool> disableBoxedProcedureRewrite;
+
+extern llvm::cl::opt<bool> disableExternalNameConversion;
+extern llvm::cl::opt<bool> enableConstantArgumentGlobalisation;
+extern llvm::cl::opt<bool> disableCompilerGeneratedNamesConversion;
+
+#endif // FORTRAN_COMMON_COMMANDLINE_OPTS_H
diff --git a/flang/include/flang/Optimizer/Passes/Pipelines.h b/flang/include/flang/Optimizer/Passes/Pipelines.h
new file mode 100644
index 00000000000000..8980bfbb90e9a0
--- /dev/null
+++ b/flang/include/flang/Optimizer/Passes/Pipelines.h
@@ -0,0 +1,128 @@
+//===-- Pipelines.h -- FIR pass pipelines -----------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+/// This file declares some utilties to setup FIR pass pipelines. These are
+/// common to flang and the test tools.
+
+#ifndef FORTRAN_OPTIMIZER_PASSES_PIPELINES_H
+#define FORTRAN_OPTIMIZER_PASSES_PIPELINES_H
+
+#include "flang/Common/CommandLineOpts.h"
+#include "flang/Optimizer/CodeGen/CodeGen.h"
+#include "flang/Optimizer/HLFIR/Passes.h"
+#include "flang/Optimizer/OpenMP/Passes.h"
+#include "flang/Optimizer/Transforms/Passes.h"
+#include "flang/Tools/CrossToolHelpers.h"
+#include "mlir/Conversion/ReconcileUnrealizedCasts/ReconcileUnrealizedCasts.h"
+#include "mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h"
+#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
+#include "mlir/Pass/PassManager.h"
+#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
+#include "mlir/Transforms/Passes.h"
+#include "llvm/Frontend/Debug/Options.h"
+#include "llvm/Passes/OptimizationLevel.h"
+#include "llvm/Support/CommandLine.h"
+
+namespace {
+
+using PassConstructor = std::unique_ptr<mlir::Pass>();
+
+template <typename OP>
+void addNestedPassToOps(mlir::PassManager &pm, PassConstructor ctor) {
+ pm.addNestedPass<OP>(ctor());
+}
+
+template <typename OP, typename... OPS,
+ typename = std::enable_if_t<sizeof...(OPS) != 0>>
+void addNestedPassToOps(mlir::PassManager &pm, PassConstructor ctor) {
+ addNestedPassToOps<OP>(pm, ctor);
+ addNestedPassToOps<OPS...>(pm, ctor);
+}
+
+/// Generic for adding a pass to the pass manager if it is not disabled.
+template <typename F>
+void addPassConditionally(mlir::PassManager &pm, llvm::cl::opt<bool> &disabled,
+ F ctor) {
+ if (!disabled)
+ pm.addPass(ctor());
+}
+
+template <typename OP, typename F>
+void addNestedPassConditionally(mlir::PassManager &pm,
+ llvm::cl::opt<bool> &disabled, F ctor) {
+ if (!disabled)
+ pm.addNestedPass<OP>(ctor());
+}
+
+} // namespace
+
+namespace fir {
+
+void addDebugInfoPass(mlir::PassManager &pm,
+ llvm::codegenoptions::DebugInfoKind debugLevel,
+ llvm::OptimizationLevel optLevel,
+ llvm::StringRef inputFilename);
+
+void addFIRToLLVMPass(mlir::PassManager &pm,
+ const MLIRToLLVMPassPipelineConfig &config);
+
+void addLLVMDialectToLLVMPass(mlir::PassManager &pm, llvm::raw_ostream &output);
+
+/// Use inliner extension point callback to register the default inliner pass.
+void registerDefaultInlinerPass(MLIRToLLVMPassPipelineConfig &config);
+
+/// Create a pass pipeline for running default optimization passes for
+/// incremental conversion of FIR.
+///
+/// \param pm - MLIR pass manager that will hold the pipeline definition
+void createDefaultFIROptimizerPassPipeline(mlir::PassManager &pm,
+ MLIRToLLVMPassPipelineConfig &pc);
+
+/// Create a pass pipeline for lowering from HLFIR to FIR
+///
+/// \param pm - MLIR pass manager that will hold the pipeline definition
+/// \param optLevel - optimization level used for creating FIR optimization
+/// passes pipeline
+void createHLFIRToFIRPassPipeline(
+ mlir::PassManager &pm, llvm::OptimizationLevel optLevel = defaultOptLevel);
+
+/// Create a pass pipeline for handling certain OpenMP transformations needed
+/// prior to FIR lowering.
+///
+/// WARNING: These passes must be run immediately after the lowering to ensure
+/// that the FIR is correct with respect to OpenMP operations/attributes.
+///
+/// \param pm - MLIR pass manager that will hold the pipeline definition.
+/// \param isTargetDevice - Whether code is being generated for a target device
+/// rather than the host device.
+void createOpenMPFIRPassPipeline(mlir::PassManager &pm, bool isTargetDevice);
+
+#if !defined(FLANG_EXCLUDE_CODEGEN)
+void createDebugPasses(mlir::PassManager &pm,
+ llvm::codegenoptions::DebugInfoKind debugLevel,
+ llvm::OptimizationLevel OptLevel,
+ llvm::StringRef inputFilename);
+
+void createDefaultFIRCodeGenPassPipeline(mlir::PassManager &pm,
+ MLIRToLLVMPassPipelineConfig config,
+ llvm::StringRef inputFilename = {});
+
+/// Create a pass pipeline for lowering from MLIR to LLVM IR
+///
+/// \param pm - MLIR pass manager that will hold the pipeline definition
+/// \param optLevel - optimization level used for creating FIR optimization
+/// passes pipeline
+void createMLIRToLLVMPassPipeline(mlir::PassManager &pm,
+ MLIRToLLVMPassPipelineConfig &config,
+ llvm::StringRef inputFilename = {});
+#undef FLANG_EXCLUDE_CODEGEN
+#endif
+
+} // namespace fir
+
+#endif // FORTRAN_OPTIMIZER_PASSES_PIPELINES_H
diff --git a/flang/include/flang/Tools/CLOptions.inc b/flang/include/flang/Tools/CLOptions.inc
deleted file mode 100644
index 04b7f0ba370b86..00000000000000
--- a/flang/include/flang/Tools/CLOptions.inc
+++ /dev/null
@@ -1,438 +0,0 @@
-//===-- CLOptions.inc -- command line options -------------------*- 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
-//
-//===----------------------------------------------------------------------===//
-
-/// This file defines some shared command-line options that can be used when
-/// debugging the test tools. This file must be included into the tool.
-
-#include "mlir/Conversion/ReconcileUnrealizedCasts/ReconcileUnrealizedCasts.h"
-#include "mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h"
-#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
-#include "mlir/Pass/PassManager.h"
-#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
-#include "mlir/Transforms/Passes.h"
-#include "flang/Optimizer/CodeGen/CodeGen.h"
-#include "flang/Optimizer/HLFIR/Passes.h"
-#include "flang/Optimizer/OpenMP/Passes.h"
-#include "flang/Optimizer/Transforms/Passes.h"
-#include "llvm/Passes/OptimizationLevel.h"
-#include "llvm/Support/CommandLine.h"
-#include <type_traits>
-
-#define DisableOption(DOName, DOOption, DODescription) \
- static llvm::cl::opt<bool> disable##DOName("disable-" DOOption, \
- llvm::cl::desc("disable " DODescription " pass"), llvm::cl::init(false), \
- llvm::cl::Hidden)
-#define EnableOption(EOName, EOOption, EODescription) \
- static llvm::cl::opt<bool> enable##EOName("enable-" EOOption, \
- llvm::cl::desc("enable " EODescription " pass"), llvm::cl::init(false), \
- llvm::cl::Hidden)
-
-/// Shared option in tools to control whether dynamically sized array
-/// allocations should always be on the heap.
-static llvm::cl::opt<bool> dynamicArrayStackToHeapAllocation(
- "fdynamic-heap-array",
- llvm::cl::desc("place all array allocations of dynamic size on the heap"),
- llvm::cl::init(false), llvm::cl::Hidden);
-
-/// Shared option in tools to set a maximum value for the number of elements in
-/// a compile-time sized array that can be allocated on the stack.
-static llvm::cl::opt<std::size_t> arrayStackAllocationThreshold(
- "fstack-array-size",
- llvm::cl::desc(
- "place all array allocations more than <size> elements on the heap"),
- llvm::cl::init(~static_cast<std::size_t>(0)), llvm::cl::Hidden);
-
-/// Shared option in tools to ignore missing runtime type descriptor objects
-/// when translating FIR to LLVM. The resulting program will crash if the
-/// runtime needs the derived type descriptors, this is only a debug option to
-/// allow compiling manually written FIR programs involving derived types
-/// without having to write the derived type descriptors which are normally
-/// generated by the frontend.
-static llvm::cl::opt<bool> ignoreMissingTypeDescriptors(
- "ignore-missing-type-desc",
- llvm::cl::desc("ignore failures to find derived type descriptors when "
- "translating FIR to LLVM"),
- llvm::cl::init(false), llvm::cl::Hidden);
-
-namespace {
-/// Default optimization level used to create Flang pass pipeline is O0.
-const static llvm::OptimizationLevel &defaultOptLevel{
- llvm::OptimizationLevel::O0};
-
-const static llvm::codegenoptions::DebugInfoKind &NoDebugInfo{
- llvm::codegenoptions::NoDebugInfo};
-
-/// Optimizer Passes
-DisableOption(CfgConversion, "cfg-conversion", "disable FIR to CFG pass");
-DisableOption(FirAvc, "avc", "array value copy analysis and transformation");
-DisableOption(
- FirMao, "memory-allocation-opt", "memory allocation optimization");
-
-DisableOption(FirAliasTags, "fir-alias-tags", "fir alias analysis");
-static llvm::cl::opt<bool> useOldAliasTags("use-old-alias-tags",
- llvm::cl::desc("Use a single TBAA tree for all functions and do not use "
- "the FIR alias tags pass"),
- llvm::cl::init(false), llvm::cl::Hidden);
-
-/// CodeGen Passes
-#if !defined(FLANG_EXCLUDE_CODEGEN)
-DisableOption(CodeGenRewrite, "codegen-rewrite", "rewrite FIR for codegen");
-DisableOption(TargetRewrite, "target-rewrite", "rewrite FIR for target");
-DisableOption(DebugInfo, "debug-info", "Add debug info");
-DisableOption(FirToLlvmIr, "fir-to-llvmir", "FIR to LLVM-IR dialect");
-DisableOption(LlvmIrToLlvm, "llvm", "conversion to LLVM");
-DisableOption(BoxedProcedureRewrite, "boxed-procedure-rewrite",
- "rewrite boxed procedures");
-#endif
-
-DisableOption(ExternalNameConversion, "external-name-interop",
- "convert names with external convention");
-EnableOption(ConstantArgumentGlobalisation, "constant-argument-globalisation",
- "the local constant argument to global constant conversion");
-DisableOption(CompilerGeneratedNamesConversion, "compiler-generated-names",
- "replace special symbols in compiler generated names");
-
-using PassConstructor = std::unique_ptr<mlir::Pass>();
-
-template <typename OP>
-void addNestedPassToOps(mlir::PassManager &pm, PassConstructor ctor) {
- pm.addNestedPass<OP>(ctor());
-}
-
-template <typename OP, typename... OPS,
- typename = std::enable_if_t<sizeof...(OPS) != 0>>
-void addNestedPassToOps(mlir::PassManager &pm, PassConstructor ctor) {
- addNestedPassToOps<OP>(pm, ctor);
- addNestedPassToOps<OPS...>(pm, ctor);
-}
-
-void addNestedPassToAllTopLevelOperations(
- mlir::PassManager &pm, PassConstructor ctor) {
- addNestedPassToOps<mlir::func::FuncOp, mlir::omp::DeclareReductionOp,
- mlir::omp::PrivateClauseOp, fir::GlobalOp>(pm, ctor);
-}
-
-void addNestedPassToAllTopLevelOperationsConditionally(mlir::PassManager &pm,
- llvm::cl::opt<bool> &disabled, PassConstructor ctor) {
- if (!disabled)
- addNestedPassToAllTopLevelOperations(pm, ctor);
-}
-
-/// Generic for adding a pass to the pass manager if it is not disabled.
-template <typename F>
-void addPassConditionally(
- mlir::PassManager &pm, llvm::cl::opt<bool> &disabled, F ctor) {
- if (!disabled)
- pm.addPass(ctor());
-}
-
-template <typename OP, typename F>
-void addNestedPassConditionally(
- mlir::PassManager &pm, llvm::cl::opt<bool> &disabled, F ctor) {
- if (!disabled)
- pm.addNestedPass<OP>(ctor());
-}
-
-} // namespace
-
-namespace fir {
-
-/// Add MLIR Canonicalizer pass with region simplification disabled.
-/// FIR does not support the promotion of some SSA value to block arguments (or
-/// into arith.select operands) that may be done by mlir block merging in the
-/// region simplification (e.g., !fir.shape<> SSA values are not supported as
-/// block arguments).
-/// Aside from the fir.shape issue, moving some abstract SSA value into block
-/// arguments may have a heavy cost since it forces their code generation that
-/// may be expensive (array temporary). The MLIR pass does not take these
-/// extra costs into account when doing block merging.
-static void addCanonicalizerPassWithoutRegionSimplification(
- mlir::OpPassManager &pm) {
- mlir::GreedyRewriteConfig config;
- config.enableRegionSimplification = mlir::GreedySimplifyRegionLevel::Disabled;
- pm.addPass(mlir::createCanonicalizerPass(config));
-}
-
-inline void addCfgConversionPass(
- mlir::PassManager &pm, const MLIRToLLVMPassPipelineConfig &config) {
- if (config.NSWOnLoopVarInc)
- addNestedPassToAllTopLevelOperationsConditionally(
- pm, disableCfgConversion, fir::createCFGConversionPassWithNSW);
- else
- addNestedPassToAllTopLevelOperationsConditionally(
- pm, disableCfgConversion, fir::createCFGConversion);
-}
-
-inline void addAVC(
- mlir::PassManager &pm, const llvm::OptimizationLevel &optLevel) {
- ArrayValueCopyOptions options;
- options.optimizeConflicts = optLevel.isOptimizingForSpeed();
- addNestedPassConditionally<mlir::func::FuncOp>(
- pm, disableFirAvc, [&]() { return createArrayValueCopyPass(options); });
-}
-
-inline void addMemoryAllocationOpt(mlir::PassManager &pm) {
- addNestedPassConditionally<mlir::func::FuncOp>(pm, disableFirMao, [&]() {
- return fir::createMemoryAllocationOpt(
- {dynamicArrayStackToHeapAllocation, arrayStackAllocationThreshold});
- });
-}
-
-#if !defined(FLANG_EXCLUDE_CODEGEN)
-inline void addCodeGenRewritePass(mlir::PassManager &pm, bool preserveDeclare) {
- fir::CodeGenRewriteOptions options;
- options.preserveDeclare = preserveDeclare;
- addPassConditionally(pm, disableCodeGenRewrite,
- [&]() { return fir::createCodeGenRewrite(options); });
-}
-
-inline void addTargetRewritePass(mlir::PassManager &pm) {
- addPassConditionally(pm, disableTargetRewrite,
- []() { return fir::createTargetRewritePass(); });
-}
-
-inline mlir::LLVM::DIEmissionKind getEmissionKind(
- llvm::codegenoptions::DebugInfoKind kind) {
- switch (kind) {
- case llvm::codegenoptions::DebugInfoKind::FullDebugInfo:
- return mlir::LLVM::DIEmissionKind::Full;
- case llvm::codegenoptions::DebugInfoKind::DebugLineTablesOnly:
- return mlir::LLVM::DIEmissionKind::LineTablesOnly;
- default:
- return mlir::LLVM::DIEmissionKind::None;
- }
-}
-
-inline void addDebugInfoPass(mlir::PassManager &pm,
- llvm::codegenoptions::DebugInfoKind debugLevel,
- llvm::OptimizationLevel optLevel, llvm::StringRef inputFilename) {
- fir::AddDebugInfoOptions options;
- options.debugLevel = getEmissionKind(debugLevel);
- options.isOptimized = optLevel != llvm::OptimizationLevel::O0;
- options.inputFilename = inputFilename;
- addPassConditionally(pm, disableDebugInfo,
- [&]() { return fir::createAddDebugInfoPass(options); });
-}
-
-inline void addFIRToLLVMPass(
- mlir::PassManager &pm, const MLIRToLLVMPassPipelineConfig &config) {
- fir::FIRToLLVMPassOptions options;
- options.ignoreMissingTypeDescriptors = ignoreMissingTypeDescriptors;
- options.applyTBAA = config.AliasAnalysis;
- options.forceUnifiedTBAATree = useOldAliasTags;
- options.typeDescriptorsRenamedForAssembly =
- !disableCompilerGeneratedNamesConversion;
- addPassConditionally(pm, disableFirToLlvmIr,
- [&]() { return fir::createFIRToLLVMPass(options); });
- // The dialect conversion framework may leave dead unrealized_conversion_cast
- // ops behind, so run reconcile-unrealized-casts to clean them up.
- addPassConditionally(pm, disableFirToLlvmIr,
- [&]() { return mlir::createReconcileUnrealizedCastsPass(); });
-}
-
-inline void addLLVMDialectToLLVMPass(
- mlir::PassManager &pm, llvm::raw_ostream &output) {
- addPassConditionally(pm, disableLlvmIrToLlvm,
- [&]() { return fir::createLLVMDialectToLLVMPass(output); });
-}
-
-inline void addBoxedProcedurePass(mlir::PassManager &pm) {
- addPassConditionally(pm, disableBoxedProcedureRewrite,
- [&]() { return fir::createBoxedProcedurePass(); });
-}
-#endif
-
-inline void addExternalNameConversionPass(
- mlir::PassManager &pm, bool appendUnderscore = true) {
- addPassConditionally(pm, disableExternalNameConversion,
- [&]() { return fir::createExternalNameConversion({appendUnderscore}); });
-}
-
-inline void addCompilerGeneratedNamesConversionPass(mlir::PassManager &pm) {
- addPassConditionally(pm, disableCompilerGeneratedNamesConversion,
- [&]() { return fir::createCompilerGeneratedNamesConversion(); });
-}
-
-// Use inliner extension point callback to register the default inliner pass.
-inline v...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/109874
More information about the flang-commits
mailing list