LLVM/project c1a2292 — flang/include/flang/Optimizer/Support InitFIR.h, flang/lib/Optimizer/Passes Pipelines.cpp
[MLIR][NFC] Retire `let constructor` for passes in Conversion directory (part1) (#127403) `let constructor` is deprecated since the table gen backend emits most of the glue logic to build a pass. This PR retires the td method for most (I need another pass) passes in the Conversion directory.
@@ -112,7 +112,7 @@ inline void registerMLIRPass | |||
mlir::affine::registerAffineLo | mlir::affine::registerAffineLo | ||
mlir::affine::registerAffineDa | mlir::affine::registerAffineDa | ||
- | + mlir::registerLowerAffinePass(); | ||
} | } | ||
/// Register the interfaces needed to lower to LLVM IR. | /// Register the interfaces needed to lower to LLVM IR. |
@@ -205,7 +205,7 @@ void createDefaultFIR | |||
pm, fir::createStackRecla | pm, fir::createStackRecla | ||
// convert control flow to CFG form | // convert control flow to CFG form | ||
fir::addCfgConversion | fir::addCfgConversion | ||
- pm.addPass( | + pm.addPass(mlir::createSCFToControlFlowPass()); | ||
pm.addPass(mlir::createCanonicali | pm.addPass(mlir::createCanonicali | ||
pm.addPass(fir::createSimplifyRe | pm.addPass(fir::createSimplifyRe |
@@ -18,7 +18,7 @@ class LLVMTypeConverte | |||
class RewritePatternSe | class RewritePatternSe | ||
class Pass; | class Pass; | ||
-#define | +#define GEN_PASS_DECL_CONVERTAMDGPUTOROCDLPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
/// Note: The ROCDL target does not support the LLVM bfloat type at this time | /// Note: The ROCDL target does not support the LLVM bfloat type at this time | ||
@@ -28,8 +28,6 @@ void populateAMDGPUTo | |||
RewritePatternSe | RewritePatternSe | ||
amdgpu::Chipset chipset); | amdgpu::Chipset chipset); | ||
-std::unique_ptr<Pass> createConvertAMD | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -24,7 +24,7 @@ namespace affine { | |||
class AffineForOp; | class AffineForOp; | ||
} // namespace affine | } // namespace affine | ||
-#define | +#define GEN_PASS_DECL_LOWERAFFINEPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
/// Collect a set of patterns to convert from the Affine dialect to the Standard | /// Collect a set of patterns to convert from the Affine dialect to the Standard | ||
@@ -44,11 +44,6 @@ Value lowerAffineLower | |||
/// standard arithmetic operations. | /// standard arithmetic operations. | ||
Value lowerAffineUpper | Value lowerAffineUpper | ||
-/// Lowers affine control flow operations (ForStmt, IfStmt and AffineApplyOp) | |||
-/// to equivalent lower-level constructs (flow of basic blocks and arithmetic | |||
-/// primitives). | |||
-std::unique_ptr<Pass> createLowerAffin | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -18,7 +18,7 @@ class SPIRVTypeConvert | |||
class RewritePatternSe | class RewritePatternSe | ||
class Pass; | class Pass; | ||
-#define | +#define GEN_PASS_DECL_CONVERTARITHTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
namespace arith { | namespace arith { |
@@ -15,18 +15,13 @@ namespace mlir { | |||
class Pass; | class Pass; | ||
class RewritePatternSe | class RewritePatternSe | ||
-#define | +#define GEN_PASS_DECL_CONVERTARMNEON2DTOINTRPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
/// Populates patterns for the lowering of Arm NEON 2D ops to intrinsics. | /// Populates patterns for the lowering of Arm NEON 2D ops to intrinsics. | ||
/// See createConvertArm | /// See createConvertArm | ||
void populateConvertA | void populateConvertA | ||
-/// Creates a pass to lower Arm NEON 2D ops to intrinsics, i.e. | |||
-/// equivalent ops operating on flattened 1D vectors and mapping more | |||
-/// directly to the corresponding Arm NEON instruction. | |||
-std::unique_ptr<Pass> createConvertArm | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -15,15 +15,12 @@ namespace mlir { | |||
class Pass; | class Pass; | ||
class RewritePatternSe | class RewritePatternSe | ||
-#define | +#define GEN_PASS_DECL_CONVERTARMSMETOSCFPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
/// Collect a set of patterns to convert from the ArmSME dialect to SCF. | /// Collect a set of patterns to convert from the ArmSME dialect to SCF. | ||
void populateArmSMETo | void populateArmSMETo | ||
-/// Create a pass to convert a subset of ArmSME ops to SCF. | |||
-std::unique_ptr<Pass> createConvertArm | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -15,10 +15,9 @@ | |||
namespace mlir { | namespace mlir { | ||
class ModuleOp; | class ModuleOp; | ||
-#define | +#define GEN_PASS_DECL_CONVERTBUFFERIZATIONTOMEMREFPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
-std::unique_ptr<Pass> createBufferizat | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -8,6 +8,7 @@ | |||
#ifndef MLIR_CONVERSION_ | #ifndef MLIR_CONVERSION_ | ||
#define MLIR_CONVERSION_ | #define MLIR_CONVERSION_ | ||
+#include "mlir/Pass/Pass.h" | |||
#include "mlir/Transforms/DialectConversio | #include "mlir/Transforms/DialectConversio | ||
namespace mlir { | namespace mlir { | ||
@@ -22,9 +23,6 @@ class OperationPass; | |||
void populateComplexT | void populateComplexT | ||
PatternBenefit benefit); | PatternBenefit benefit); | ||
-/// Create a pass to convert Complex operations to libm calls. | |||
-std::unique_ptr<OperationPass<ModuleOp>> createConvertCom | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -16,7 +16,7 @@ namespace mlir { | |||
class RewritePatternSe | class RewritePatternSe | ||
class Pass; | class Pass; | ||
-#define | +#define GEN_PASS_DECL_CONVERTCOMPLEXTOSTANDARDPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
/// Populate the given list with patterns that convert from Complex to Standard. | /// Populate the given list with patterns that convert from Complex to Standard. | ||
@@ -25,11 +25,6 @@ void populateComplexT | |||
mlir::complex::ComplexRangeFlag | mlir::complex::ComplexRangeFlag | ||
mlir::complex::ComplexRangeFlag | mlir::complex::ComplexRangeFlag | ||
-/// Create a pass to convert Complex operations to the Standard dialect. | |||
-std::unique_ptr<Pass> createConvertCom | |||
-std::unique_ptr<Pass> | |||
-createConvertCom | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -18,12 +18,9 @@ | |||
namespace mlir { | namespace mlir { | ||
class ModuleOp; | class ModuleOp; | ||
-#define | +#define GEN_PASS_DECL_CONVERTCONTROLFLOWTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
-/// Creates a pass to convert ControlFlow ops to SPIR-V ops. | |||
-std::unique_ptr<OperationPass<>> createConvertCon | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -13,14 +13,10 @@ | |||
#include "mlir/Pass/Pass.h" | #include "mlir/Pass/Pass.h" | ||
-#define GEN_PASS_DECL_CO | |||
-#include "mlir/Conversion/Passes.h.inc" | |||
- | |||
namespace mlir { | namespace mlir { | ||
-/// Create a pass that performs dialect conversion to LLVM for all dialects | +#define GEN_PASS_DECL_CO | ||
-/// implementing `ConvertToLLVMPat | +#include "mlir/Conversion/Passes.h.inc" | ||
-std::unique_ptr<Pass> createConvertToL | |||
/// Register the extension that will load dependent dialects for LLVM | /// Register the extension that will load dependent dialects for LLVM | ||
/// conversion. This is useful to implement a pass similar to "convert-to-llvm". | /// conversion. This is useful to implement a pass similar to "convert-to-llvm". |
@@ -18,12 +18,9 @@ | |||
namespace mlir { | namespace mlir { | ||
class ModuleOp; | class ModuleOp; | ||
-#define | +#define GEN_PASS_DECL_CONVERTFUNCTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
-/// Creates a pass to convert Func ops to SPIR-V ops. | |||
-std::unique_ptr<OperationPass<>> createConvertFun | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -10,6 +10,7 @@ | |||
#define MLIR_CONVERSION_ | #define MLIR_CONVERSION_ | ||
#include "mlir/Dialect/Linalg/IR/Linalg.h" | #include "mlir/Dialect/Linalg/IR/Linalg.h" | ||
+#include "mlir/Pass/Pass.h" | |||
#include "mlir/Transforms/DialectConversio | #include "mlir/Transforms/DialectConversio | ||
namespace mlir { | namespace mlir { | ||
@@ -17,7 +18,7 @@ class ModuleOp; | |||
template <typename T> | template <typename T> | ||
class OperationPass; | class OperationPass; | ||
-#define | +#define GEN_PASS_DECL_CONVERTLINALGTOSTANDARDPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
namespace linalg { | namespace linalg { | ||
@@ -46,10 +47,6 @@ public: | |||
void populateLinalgTo | void populateLinalgTo | ||
} // namespace linalg | } // namespace linalg | ||
- | |||
-/// Create a pass to convert Linalg operations to the Standard dialect. | |||
-std::unique_ptr<OperationPass<ModuleOp>> createConvertLin | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -9,12 +9,13 @@ | |||
#define MLIR_CONVERSION_ | #define MLIR_CONVERSION_ | ||
#include "mlir/IR/PatternMatch.h" | #include "mlir/IR/PatternMatch.h" | ||
+#include "mlir/Pass/Pass.h" | |||
namespace mlir { | namespace mlir { | ||
template <typename T> | template <typename T> | ||
class OperationPass; | class OperationPass; | ||
-#define | +#define GEN_PASS_DECL_CONVERTMATHTOLIBMPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
/// Populate the given list with patterns that convert from Math to Libm calls. | /// Populate the given list with patterns that convert from Math to Libm calls. | ||
@@ -22,9 +23,6 @@ class OperationPass; | |||
void populateMathToLi | void populateMathToLi | ||
PatternBenefit benefit = 1); | PatternBenefit benefit = 1); | ||
-/// Create a pass to convert Math operations to libm calls. | |||
-std::unique_ptr<OperationPass<ModuleOp>> createConvertMat | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -18,12 +18,9 @@ | |||
namespace mlir { | namespace mlir { | ||
class ModuleOp; | class ModuleOp; | ||
-#define | +#define GEN_PASS_DECL_CONVERTMATHTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
-/// Creates a pass to convert Math ops to SPIR-V ops. | |||
-std::unique_ptr<OperationPass<>> createConvertMat | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -20,16 +20,13 @@ namespace mlir { | |||
class ModuleOp; | class ModuleOp; | ||
#define GEN_PASS_DECL_MA | #define GEN_PASS_DECL_MA | ||
-#define | +#define GEN_PASS_DECL_CONVERTMEMREFTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
/// Creates a pass to map numeric MemRef memory spaces to symbolic SPIR-V | /// Creates a pass to map numeric MemRef memory spaces to symbolic SPIR-V | ||
/// storage classes. The mapping is read from the command-line option. | /// storage classes. The mapping is read from the command-line option. | ||
std::unique_ptr<OperationPass<>> createMapMemRefS | std::unique_ptr<OperationPass<>> createMapMemRefS | ||
-/// Creates a pass to convert MemRef ops to SPIR-V ops. | |||
-std::unique_ptr<OperationPass<>> createConvertMem | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -18,10 +18,6 @@ class Pass; | |||
#define GEN_PASS_DECL_CO | #define GEN_PASS_DECL_CO | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
-/// Lowers Mesh communication operations (updateHalo, AllGater, ...) | |||
-/// to MPI primitives. | |||
-std::unique_ptr<::mlir::Pass> createConvertMes | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -8,6 +8,7 @@ | |||
#ifndef MLIR_CONVERSION_ | #ifndef MLIR_CONVERSION_ | ||
#define MLIR_CONVERSION_ | #define MLIR_CONVERSION_ | ||
+#include "mlir/Pass/Pass.h" | |||
#include <memory> | #include <memory> | ||
namespace mlir { | namespace mlir { | ||
@@ -16,16 +17,13 @@ template <typename T> | |||
class OperationPass; | class OperationPass; | ||
class RewritePatternSe | class RewritePatternSe | ||
-#define | +#define GEN_PASS_DECL_CONVERTOPENACCTOSCFPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
/// Collect the patterns to convert from the OpenACC dialect to OpenACC with | /// Collect the patterns to convert from the OpenACC dialect to OpenACC with | ||
/// SCF dialect. | /// SCF dialect. | ||
void populateOpenACCT | void populateOpenACCT | ||
-/// Create a pass to convert the OpenACC dialect into the LLVMIR dialect. | |||
-std::unique_ptr<OperationPass<ModuleOp>> createConvertOpe | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -13,6 +13,7 @@ | |||
#ifndef MLIR_CONVERSION_ | #ifndef MLIR_CONVERSION_ | ||
#define MLIR_CONVERSION_ | #define MLIR_CONVERSION_ | ||
+#include "mlir/Pass/Pass.h" | |||
#include "mlir/Support/LLVM.h" | #include "mlir/Support/LLVM.h" | ||
namespace mlir { | namespace mlir { | ||
@@ -22,16 +23,13 @@ template <typename OpT> | |||
class OperationPass; | class OperationPass; | ||
class PDLPatternConfig | class PDLPatternConfig | ||
-#define | +#define GEN_PASS_DECL_CONVERTPDLTOPDLINTERPPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
-/// Creates and returns a pass to convert PDL ops to PDL interpreter ops. | |||
-std::unique_ptr<OperationPass<ModuleOp>> createPDLToPDLIn | |||
- | |||
/// Creates and returns a pass to convert PDL ops to PDL interpreter ops. | /// Creates and returns a pass to convert PDL ops to PDL interpreter ops. | ||
/// `configMap` holds a map of the configurations for each pattern being | /// `configMap` holds a map of the configurations for each pattern being | ||
/// compiled. | /// compiled. | ||
-std::unique_ptr<OperationPass<ModuleOp>> | +std::unique_ptr<OperationPass<ModuleOp>> createConvertPDLToPDLInterpPass( | ||
DenseMap<Operation *, PDLPatternConfig | DenseMap<Operation *, PDLPatternConfig | ||
} // namespace mlir | } // namespace mlir |
@@ -30,7 +30,6 @@ def ConvertToLLVMPas | |||
extra overhead. | extra overhead. | ||
}]; | }]; | ||
- let constructor = "mlir::createConvertToL | |||
let options = [ | let options = [ | ||
ListOption<"filterDialects", "filter-dialects", "std::string", | ListOption<"filterDialects", "filter-dialects", "std::string", | ||
"Test conversion patterns of only the specified dialects">, | "Test conversion patterns of only the specified dialects">, | ||
@@ -40,11 +39,11 @@ def ConvertToLLVMPas | |||
} | } | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-// AffineToStandard | +// LowerAffine | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def LowerAffinePass : Pass<"lower-affine"> { | ||
- let summary = "Lower Affine operations to a combination of | + let summary = "Lower Affine operations to a combination of Arith and SCF " | ||
"operations"; | "operations"; | ||
let description = [{ | let description = [{ | ||
@@ -55,7 +54,7 @@ def ConvertAffineToS | |||
of certain structural restrictions (on their bounds and step). `affine.if` | of certain structural restrictions (on their bounds and step). `affine.if` | ||
is similarly converted to the `scf.if` operation. `affine.apply` operations | is similarly converted to the `scf.if` operation. `affine.apply` operations | ||
are converted into sequences of primitive arithmetic operations from the | are converted into sequences of primitive arithmetic operations from the | ||
- | + arith dialect that have the same effect, using operands of the `index` | ||
type. Consequently, named maps and sets thare are no longer in use may be | type. Consequently, named maps and sets thare are no longer in use may be | ||
removed from the module. | removed from the module. | ||
@@ -93,24 +92,19 @@ def ConvertAffineToS | |||
if they do not depend on the loop iterator value or on the result of | if they do not depend on the loop iterator value or on the result of | ||
`affine.apply`. | `affine.apply`. | ||
}]; | }]; | ||
- let constructor = "mlir::createLowerAffin | + let dependentDialect | ||
- let dependentDialect | + "scf::SCFDialect", "vector::VectorDialect"]; | ||
- "memref::MemRefDialect", | |||
- "scf::SCFDialect", | |||
- "vector::VectorDialect" | |||
- ]; | |||
} | } | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
// AMDGPUToROCDL | // AMDGPUToROCDL | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertAMDGPUToROCDLPass : Pass<"convert-amdgpu-to-rocdl"> { | ||
let summary = "Convert AMDGPU dialect to ROCDL dialect"; | let summary = "Convert AMDGPU dialect to ROCDL dialect"; | ||
let description = [{ | let description = [{ | ||
This pass converts supported AMDGPU ops to ROCDL dialect intrinsics. | This pass converts supported AMDGPU ops to ROCDL dialect intrinsics. | ||
}]; | }]; | ||
- let constructor = "mlir::createConvertAMD | |||
let dependentDialect | let dependentDialect | ||
"LLVM::LLVMDialect", | "LLVM::LLVMDialect", | ||
"ROCDL::ROCDLDialect", | "ROCDL::ROCDLDialect", | ||
@@ -177,9 +171,8 @@ def ArithToLLVMConve | |||
// ArithToSPIRV | // ArithToSPIRV | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertArithToSPIRVPass : Pass<"convert-arith-to-spirv"> { | ||
let summary = "Convert Arith dialect to SPIR-V dialect"; | let summary = "Convert Arith dialect to SPIR-V dialect"; | ||
- let constructor = "mlir::arith::createConvertAri | |||
let dependentDialect | let dependentDialect | ||
let options = [ | let options = [ | ||
Option<"emulateLT32BitSc | Option<"emulateLT32BitSc | ||
@@ -202,9 +195,13 @@ def ArithToArmSMECon | |||
// ArmNeon2dToIntr | // ArmNeon2dToIntr | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertArmNeon2dToIntrPass : Pass<"arm-neon-2d-to-intr"> { | ||
let summary = "Convert Arm NEON structured ops to intrinsics"; | let summary = "Convert Arm NEON structured ops to intrinsics"; | ||
- let constructor = "mlir::createConvertArm | + let description = [{ | ||
+ Creates a pass to lower Arm NEON 2D ops to intrinsics, i.e. | |||
+ equivalent ops operating on flattened 1D vectors and mapping more | |||
+ directly to the corresponding Arm NEON instruction. | |||
+ }]; | |||
let dependentDialect | let dependentDialect | ||
} | } | ||
@@ -231,7 +228,7 @@ def ConvertAsyncToLL | |||
// BufferizationToM | // BufferizationToM | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertBufferizationToMemRefPass : Pass<"convert-bufferization-to-memref"> { | ||
let summary = "Convert operations from the Bufferization dialect to the " | let summary = "Convert operations from the Bufferization dialect to the " | ||
"MemRef dialect"; | "MemRef dialect"; | ||
let description = [{ | let description = [{ | ||
@@ -260,7 +257,6 @@ def ConvertBufferiza | |||
and hence does not resolve any memory leaks. | and hence does not resolve any memory leaks. | ||
}]; | }]; | ||
- let constructor = "mlir::createBufferizat | |||
let dependentDialect | let dependentDialect | ||
"arith::ArithDialect", "memref::MemRefDialect", "scf::SCFDialect", | "arith::ArithDialect", "memref::MemRefDialect", "scf::SCFDialect", | ||
"func::FuncDialect" | "func::FuncDialect" | ||
@@ -296,10 +292,7 @@ def ConvertComplexTo | |||
let description = [{ | let description = [{ | ||
This pass converts supported Complex ops to libm calls. | This pass converts supported Complex ops to libm calls. | ||
}]; | }]; | ||
- let constructor = "mlir::createConvertCom | + let dependentDialect | ||
- let dependentDialect | |||
- "func::FuncDialect", | |||
- ]; | |||
} | } | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
@@ -315,9 +308,8 @@ def ConvertComplexTo | |||
// ComplexToStandar | // ComplexToStandar | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertComplexToStandardPass : Pass<"convert-complex-to-standard"> { | ||
let summary = "Convert Complex dialect to standard dialect"; | let summary = "Convert Complex dialect to standard dialect"; | ||
- let constructor = "mlir::createConvertCom | |||
let dependentDialect | let dependentDialect | ||
let options = [ | let options = [ | ||
@@ -388,9 +380,8 @@ def LiftControlFlowT | |||
// ControlFlowToSPI | // ControlFlowToSPI | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertControlFlowToSPIRVPass : Pass<"convert-cf-to-spirv"> { | ||
let summary = "Convert ControlFlow dialect to SPIR-V dialect"; | let summary = "Convert ControlFlow dialect to SPIR-V dialect"; | ||
- let constructor = "mlir::createConvertCon | |||
let dependentDialect | let dependentDialect | ||
let options = [ | let options = [ | ||
Option<"emulateLT32BitSc | Option<"emulateLT32BitSc | ||
@@ -473,9 +464,8 @@ def ConvertFuncToLLV | |||
// FuncToSPIRV | // FuncToSPIRV | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertFuncToSPIRVPass : Pass<"convert-func-to-spirv"> { | ||
let summary = "Convert Func dialect to SPIR-V dialect"; | let summary = "Convert Func dialect to SPIR-V dialect"; | ||
- let constructor = "mlir::createConvertFun | |||
let dependentDialect | let dependentDialect | ||
let options = [ | let options = [ | ||
Option<"emulateLT32BitSc | Option<"emulateLT32BitSc | ||
@@ -702,10 +692,9 @@ def ConvertIndexToSP | |||
// LinalgToStandard | // LinalgToStandard | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertLinalgToStandardPass : Pass<"convert-linalg-to-std", "ModuleOp"> { | ||
let summary = "Convert the operations from the linalg dialect into the " | let summary = "Convert the operations from the linalg dialect into the " | ||
"Standard dialect"; | "Standard dialect"; | ||
- let constructor = "mlir::createConvertLin | |||
let dependentDialect | let dependentDialect | ||
} | } | ||
@@ -713,12 +702,11 @@ def ConvertLinalgToS | |||
// MathToLibm | // MathToLibm | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertMathToLibmPass : Pass<"convert-math-to-libm", "ModuleOp"> { | ||
let summary = "Convert Math dialect to libm calls"; | let summary = "Convert Math dialect to libm calls"; | ||
let description = [{ | let description = [{ | ||
This pass converts supported Math ops to libm calls. | This pass converts supported Math ops to libm calls. | ||
}]; | }]; | ||
- let constructor = "mlir::createConvertMat | |||
let dependentDialect | let dependentDialect | ||
"arith::ArithDialect", | "arith::ArithDialect", | ||
"func::FuncDialect", | "func::FuncDialect", | ||
@@ -760,9 +748,8 @@ def ConvertMathToROC | |||
// MathToSPIRV | // MathToSPIRV | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertMathToSPIRVPass : Pass<"convert-math-to-spirv"> { | ||
let summary = "Convert Math dialect to SPIR-V dialect"; | let summary = "Convert Math dialect to SPIR-V dialect"; | ||
- let constructor = "mlir::createConvertMat | |||
let dependentDialect | let dependentDialect | ||
} | } | ||
@@ -872,9 +859,8 @@ def MapMemRefStorage | |||
]; | ]; | ||
} | } | ||
-def | +def ConvertMemRefToSPIRVPass : Pass<"convert-memref-to-spirv"> { | ||
let summary = "Convert MemRef dialect to SPIR-V dialect"; | let summary = "Convert MemRef dialect to SPIR-V dialect"; | ||
- let constructor = "mlir::createConvertMem | |||
let dependentDialect | let dependentDialect | ||
let options = [ | let options = [ | ||
Option<"boolNumBits", "bool-num-bits", | Option<"boolNumBits", "bool-num-bits", | ||
@@ -892,7 +878,6 @@ def ConvertMemRefToS | |||
def ConvertMeshToMPI | def ConvertMeshToMPI | ||
let summary = "Convert Mesh dialect to MPI dialect."; | let summary = "Convert Mesh dialect to MPI dialect."; | ||
- let constructor = "mlir::createConvertMes | |||
let description = [{ | let description = [{ | ||
This pass converts communication operations from the Mesh dialect to the | This pass converts communication operations from the Mesh dialect to the | ||
MPI dialect. | MPI dialect. | ||
@@ -944,9 +929,8 @@ def ConvertNVGPUToNV | |||
// OpenACCToSCF | // OpenACCToSCF | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertOpenACCToSCFPass : Pass<"convert-openacc-to-scf", "ModuleOp"> { | ||
let summary = "Convert the OpenACC ops to OpenACC with SCF dialect"; | let summary = "Convert the OpenACC ops to OpenACC with SCF dialect"; | ||
- let constructor = "mlir::createConvertOpe | |||
let dependentDialect | let dependentDialect | ||
} | } | ||
@@ -963,9 +947,8 @@ def ConvertOpenMPToL | |||
// PDLToPDLInterp | // PDLToPDLInterp | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertPDLToPDLInterpPass : Pass<"convert-pdl-to-pdl-interp", "ModuleOp"> { | ||
let summary = "Convert PDL ops to PDL interpreter ops"; | let summary = "Convert PDL ops to PDL interpreter ops"; | ||
- let constructor = "mlir::createPDLToPDLIn | |||
let dependentDialect | let dependentDialect | ||
} | } | ||
@@ -973,7 +956,7 @@ def ConvertPDLToPDLI | |||
// ReconcileUnreali | // ReconcileUnreali | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ReconcileUnrealizedCastsPass : Pass<"reconcile-unrealized-casts"> { | ||
let summary = "Simplify and eliminate unrealized conversion casts"; | let summary = "Simplify and eliminate unrealized conversion casts"; | ||
let description = [{ | let description = [{ | ||
Eliminate `unrealized_conve | Eliminate `unrealized_conve | ||
@@ -992,17 +975,15 @@ def ReconcileUnreali | |||
and the producer operation is converted by another pass, each of which | and the producer operation is converted by another pass, each of which | ||
produces an unrealized cast. This pass can be used to clean up the IR. | produces an unrealized cast. This pass can be used to clean up the IR. | ||
}]; | }]; | ||
- let constructor = "mlir::createReconcileU | |||
} | } | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
// SCFToControlFlow | // SCFToControlFlow | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def SCFToControlFlowPass : Pass<"convert-scf-to-cf"> { | ||
let summary = "Convert SCF dialect to ControlFlow dialect, replacing structured" | let summary = "Convert SCF dialect to ControlFlow dialect, replacing structured" | ||
" control flow with a CFG"; | " control flow with a CFG"; | ||
- let constructor = "mlir::createConvertSCF | |||
let dependentDialect | let dependentDialect | ||
} | } | ||
@@ -1044,10 +1025,9 @@ def SCFToSPIRV : Pass<"convert-sc | |||
// SCFToGPU | // SCFToGPU | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertAffineForToGPUPass | ||
: InterfacePass<"convert-affine-for-to-gpu", "FunctionOpInterf | : InterfacePass<"convert-affine-for-to-gpu", "FunctionOpInterf | ||
let summary = "Convert top-level AffineFor Ops to GPU kernels"; | let summary = "Convert top-level AffineFor Ops to GPU kernels"; | ||
- let constructor = "mlir::createAffineForT | |||
let dependentDialect | let dependentDialect | ||
let options = [ | let options = [ | ||
Option<"numBlockDims", "gpu-block-dims", "unsigned", /*default=*/"1u", | Option<"numBlockDims", "gpu-block-dims", "unsigned", /*default=*/"1u", | ||
@@ -1057,9 +1037,14 @@ def ConvertAffineFor | |||
]; | ]; | ||
} | } | ||
-def | +def ConvertParallelLoopToGpuPass : Pass<"convert-parallel-loops-to-gpu"> { | ||
let summary = "Convert mapped scf.parallel ops to gpu launch operations"; | let summary = "Convert mapped scf.parallel ops to gpu launch operations"; | ||
- let constructor = "mlir::createParallelLo | + let description = [{ | ||
+ Creates a pass that converts scf.parallel operations into a gpu.launch | |||
+ operation. The mapping of loop dimensions to launch dimensions is derived | |||
+ from mapping attributes. See ParallelToGpuLau | |||
+ for a description of the used attributes. | |||
+ }]; | |||
let dependentDialect | let dependentDialect | ||
} | } | ||
@@ -1077,16 +1062,13 @@ def SCFToEmitC : Pass<"convert-sc | |||
// ShapeToStandard | // ShapeToStandard | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertShapeToStandardPass : Pass<"convert-shape-to-std", "ModuleOp"> { | ||
let summary = "Convert operations from the shape dialect into the standard " | let summary = "Convert operations from the shape dialect into the standard " | ||
"dialect"; | "dialect"; | ||
- let constructor = "mlir::createConvertSha | + let dependentDialect | ||
- let dependentDialect | |||
- "scf::SCFDialect", | |||
- ]; | |||
} | } | ||
-def | +def ConvertShapeConstraintsPass : Pass<"convert-shape-constraints"> { | ||
let summary = "Convert shape constraint operations to the standard dialect"; | let summary = "Convert shape constraint operations to the standard dialect"; | ||
let description = [{ | let description = [{ | ||
This pass eliminates shape constraints from the program, converting them to | This pass eliminates shape constraints from the program, converting them to | ||
@@ -1097,7 +1079,6 @@ def ConvertShapeCons | |||
can happen at a different part of the program than general shape | can happen at a different part of the program than general shape | ||
computation lowering. | computation lowering. | ||
}]; | }]; | ||
- let constructor = "mlir::createConvertSha | |||
let dependentDialect | let dependentDialect | ||
} | } | ||
@@ -1131,9 +1112,8 @@ def ConvertSPIRVToLL | |||
// TensorToLinalg | // TensorToLinalg | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertTensorToLinalgPass : Pass<"convert-tensor-to-linalg", "ModuleOp"> { | ||
let summary = "Convert some Tensor dialect ops to Linalg dialect"; | let summary = "Convert some Tensor dialect ops to Linalg dialect"; | ||
- let constructor = "mlir::createConvertTen | |||
let dependentDialect | let dependentDialect | ||
"arith::ArithDialect", | "arith::ArithDialect", | ||
"linalg::LinalgDialect", | "linalg::LinalgDialect", | ||
@@ -1144,9 +1124,8 @@ def ConvertTensorToL | |||
// TensorToSPIRV | // TensorToSPIRV | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertTensorToSPIRVPass : Pass<"convert-tensor-to-spirv"> { | ||
let summary = "Convert Tensor dialect to SPIR-V dialect"; | let summary = "Convert Tensor dialect to SPIR-V dialect"; | ||
- let constructor = "mlir::createConvertTen | |||
let dependentDialect | let dependentDialect | ||
let options = [ | let options = [ | ||
Option<"emulateLT32BitSc | Option<"emulateLT32BitSc | ||
@@ -1160,7 +1139,7 @@ def ConvertTensorToS | |||
// TosaToArith | // TosaToArith | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def TosaToArithPass : Pass<"tosa-to-arith"> { | ||
let summary = "Lower TOSA to the Arith dialect"; | let summary = "Lower TOSA to the Arith dialect"; | ||
let dependentDialect | let dependentDialect | ||
"arith::ArithDialect", | "arith::ArithDialect", | ||
@@ -1179,8 +1158,6 @@ def TosaToArith : Pass<"tosa-to-ar | |||
"bool", /*default=*/"false", | "bool", /*default=*/"false", | ||
"Whether to prioritze lowering to 32-bit operations"> | "Whether to prioritze lowering to 32-bit operations"> | ||
]; | ]; | ||
- | |||
- let constructor = "tosa::createTosaToArit | |||
} | } | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
@@ -1244,22 +1221,20 @@ def TosaToMLProgram : Pass<"tosa-to-ml | |||
// TosaToSCF | // TosaToSCF | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def TosaToSCFPass : Pass<"tosa-to-scf"> { | ||
let summary = "Lower TOSA to the SCF dialect"; | let summary = "Lower TOSA to the SCF dialect"; | ||
let dependentDialect | let dependentDialect | ||
let description = [{ | let description = [{ | ||
Pass that converts TOSA's control flow operations to the equivalent SCF | Pass that converts TOSA's control flow operations to the equivalent SCF | ||
operations. | operations. | ||
}]; | }]; | ||
- | |||
- let constructor = "tosa::createTosaToSCF()"; | |||
} | } | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
// TosaToTensor | // TosaToTensor | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def TosaToTensorPass : Pass<"tosa-to-tensor"> { | ||
let summary = "Lower TOSA to the Tensor dialect"; | let summary = "Lower TOSA to the Tensor dialect"; | ||
let dependentDialect | let dependentDialect | ||
"tensor::TensorDialect", | "tensor::TensorDialect", | ||
@@ -1268,8 +1243,6 @@ def TosaToTensor : Pass<"tosa-to-te | |||
Pass that converts TOSA operations to the equivalent operations using the | Pass that converts TOSA operations to the equivalent operations using the | ||
operations in the Tensor dialect. | operations in the Tensor dialect. | ||
}]; | }]; | ||
- | |||
- let constructor = "tosa::createTosaToTens | |||
} | } | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
@@ -1350,10 +1323,9 @@ def ConvertVectorToS | |||
// VectorToArmSME | // VectorToArmSME | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertVectorToArmSMEPass : Pass<"convert-vector-to-arm-sme"> { | ||
let summary = "Lower the operations from the vector dialect into the ArmSME " | let summary = "Lower the operations from the vector dialect into the ArmSME " | ||
"dialect"; | "dialect"; | ||
- let constructor = "mlir::createConvertVec | |||
let description = [{ | let description = [{ | ||
Pass that converts vector dialect operations into equivalent ArmSME dialect | Pass that converts vector dialect operations into equivalent ArmSME dialect | ||
operations. | operations. | ||
@@ -1365,10 +1337,9 @@ def ConvertVectorToA | |||
// ArmSMEToSCF | // ArmSMEToSCF | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertArmSMEToSCFPass : Pass<"convert-arm-sme-to-scf"> { | ||
let summary = "Lower the operations from the ArmSME dialect into the SCF " | let summary = "Lower the operations from the ArmSME dialect into the SCF " | ||
"dialect"; | "dialect"; | ||
- let constructor = "mlir::createConvertArm | |||
let dependentDialect | let dependentDialect | ||
"scf::SCFDialect", | "scf::SCFDialect", | ||
"arith::ArithDialect", | "arith::ArithDialect", | ||
@@ -1450,9 +1421,8 @@ def ConvertVectorToL | |||
// VectorToSPIRV | // VectorToSPIRV | ||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||
-def | +def ConvertVectorToSPIRVPass : Pass<"convert-vector-to-spirv"> { | ||
let summary = "Convert Vector dialect to SPIR-V dialect"; | let summary = "Convert Vector dialect to SPIR-V dialect"; | ||
- let constructor = "mlir::createConvertVec | |||
let dependentDialect | let dependentDialect | ||
"spirv::SPIRVDialect", | "spirv::SPIRVDialect", | ||
"ub::UBDialect" | "ub::UBDialect" | ||
@@ -1466,7 +1436,6 @@ def ConvertVectorToS | |||
def ConvertVectorToX | def ConvertVectorToX | ||
let summary = "Lower the operations from the vector dialect into the XeGPU " | let summary = "Lower the operations from the vector dialect into the XeGPU " | ||
"dialect"; | "dialect"; | ||
- let constructor = "mlir::createConvertVec | |||
let dependentDialect | let dependentDialect | ||
"memref::MemRefDialect", "arith::ArithDialect", | "memref::MemRefDialect", "arith::ArithDialect", | ||
"vector::VectorDialect", "xegpu::XeGPUDialect" | "vector::VectorDialect", "xegpu::XeGPUDialect" |
@@ -15,12 +15,9 @@ namespace mlir { | |||
class Pass; | class Pass; | ||
class RewritePatternSe | class RewritePatternSe | ||
-#define | +#define GEN_PASS_DECL_RECONCILEUNREALIZEDCASTSPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
-/// Creates a pass that eliminates noop `unrealized_conve | |||
-/// sequences. | |||
-std::unique_ptr<Pass> createReconcileU | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -15,17 +15,13 @@ namespace mlir { | |||
class Pass; | class Pass; | ||
class RewritePatternSe | class RewritePatternSe | ||
-#define | +#define GEN_PASS_DECL_SCFTOCONTROLFLOWPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
/// Collect a set of patterns to convert SCF operations to CFG branch-based | /// Collect a set of patterns to convert SCF operations to CFG branch-based | ||
/// operations within the ControlFlow dialect. | /// operations within the ControlFlow dialect. | ||
void populateSCFToCon | void populateSCFToCon | ||
-/// Creates a pass to convert SCF operations to CFG branch-based operation in | |||
-/// the ControlFlow dialect. | |||
-std::unique_ptr<Pass> createConvertSCF | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -9,6 +9,7 @@ | |||
#define MLIR_CONVERSION_ | #define MLIR_CONVERSION_ | ||
#include "mlir/Interfaces/FunctionInterfac | #include "mlir/Interfaces/FunctionInterfac | ||
+#include "mlir/Pass/Pass.h" | |||
#include "mlir/Support/LLVM.h" | #include "mlir/Support/LLVM.h" | ||
#include <memory> | #include <memory> | ||
@@ -18,28 +19,10 @@ template <typename T> | |||
class InterfacePass; | class InterfacePass; | ||
class Pass; | class Pass; | ||
-#define | +#define GEN_PASS_DECL_CONVERTAFFINEFORTOGPUPASS | ||
-#define | +#define GEN_PASS_DECL_CONVERTPARALLELLOOPTOGPUPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
-/// Create a pass that converts loop nests into GPU kernels. It considers | |||
-/// top-level affine.for operations as roots of loop nests and converts them to | |||
-/// the gpu.launch operations if possible. | |||
-/// | |||
-/// No check on the size of the block or grid, or on the validity of | |||
-/// parallelization is performed, it is under the responsibility of the caller | |||
-/// to strip-mine the loops and to perform the dependence analysis before | |||
-/// calling the conversion. | |||
-std::unique_ptr<InterfacePass<FunctionOpInterf | |||
-createAffineForT | |||
-std::unique_ptr<InterfacePass<FunctionOpInterf | |||
- | |||
-/// Creates a pass that converts scf.parallel operations into a gpu.launch | |||
-/// operation. The mapping of loop dimensions to launch dimensions is derived | |||
-/// from mapping attributes. See ParallelToGpuLau | |||
-/// for a description of the used attributes. | |||
-std::unique_ptr<Pass> createParallelLo | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -19,19 +19,15 @@ template <typename T> | |||
class OperationPass; | class OperationPass; | ||
class RewritePatternSe | class RewritePatternSe | ||
-#define | +#define GEN_PASS_DECL_CONVERTSHAPECONSTRAINTSPASS | ||
-#define | +#define GEN_PASS_DECL_CONVERTSHAPETOSTANDARDPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
void populateShapeToS | void populateShapeToS | ||
-std::unique_ptr<OperationPass<ModuleOp>> createConvertSha | |||
- | |||
void populateConvertS | void populateConvertS | ||
RewritePatternSe | RewritePatternSe | ||
-std::unique_ptr<Pass> createConvertSha | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -18,12 +18,9 @@ | |||
namespace mlir { | namespace mlir { | ||
class ModuleOp; | class ModuleOp; | ||
-#define | +#define GEN_PASS_DECL_CONVERTTENSORTOLINALGPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
-/// Creates a pass to convert Tensor ops to Linalg ops. | |||
-std::unique_ptr<OperationPass<ModuleOp>> createConvertTen | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -18,12 +18,9 @@ | |||
namespace mlir { | namespace mlir { | ||
class ModuleOp; | class ModuleOp; | ||
-#define | +#define GEN_PASS_DECL_CONVERTTENSORTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
-/// Creates a pass to convert Tensor ops to SPIR-V ops. | |||
-std::unique_ptr<OperationPass<>> createConvertTen | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -17,14 +17,11 @@ | |||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DECL_TOSATOARITHPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
namespace tosa { | namespace tosa { | ||
-std::unique_ptr<Pass> createTosaToArit | |||
- bool use32BitApplyRes | |||
- | |||
void populateTosaToAr | void populateTosaToAr | ||
void populateTosaResc | void populateTosaResc |
@@ -17,13 +17,11 @@ | |||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DECL_TOSATOSCFPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
namespace tosa { | namespace tosa { | ||
-std::unique_ptr<Pass> createTosaToSCF(); | |||
- | |||
void populateTosaToSC | void populateTosaToSC | ||
/// Populates passes to convert from TOSA to SCF. | /// Populates passes to convert from TOSA to SCF. |
@@ -18,13 +18,11 @@ | |||
namespace mlir { | namespace mlir { | ||
class TypeConverter; | class TypeConverter; | ||
-#define | +#define GEN_PASS_DECL_TOSATOTENSORPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
namespace tosa { | namespace tosa { | ||
-std::unique_ptr<Pass> createTosaToTens | |||
- | |||
void populateTosaToTe | void populateTosaToTe | ||
RewritePatternSe | RewritePatternSe | ||
@@ -13,7 +13,7 @@ | |||
namespace mlir { | namespace mlir { | ||
class Pass; | class Pass; | ||
-#define | +#define GEN_PASS_DECL_CONVERTVECTORTOARMSMEPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
/// Collect a set of patterns to lower Vector ops to ArmSME ops that map to LLVM | /// Collect a set of patterns to lower Vector ops to ArmSME ops that map to LLVM | ||
@@ -21,9 +21,6 @@ class Pass; | |||
void populateVectorTo | void populateVectorTo | ||
MLIRContext &ctx); | MLIRContext &ctx); | ||
-/// Create a pass to lower operations from the vector dialect to Arm SME. | |||
-std::unique_ptr<Pass> createConvertVec | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -18,12 +18,9 @@ | |||
namespace mlir { | namespace mlir { | ||
class ModuleOp; | class ModuleOp; | ||
-#define | +#define GEN_PASS_DECL_CONVERTVECTORTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
-/// Creates a pass to convert Vector Ops to SPIR-V ops. | |||
-std::unique_ptr<OperationPass<>> createConvertVec | |||
- | |||
} // namespace mlir | } // namespace mlir | ||
#endif // MLIR_CONVERSION_ | #endif // MLIR_CONVERSION_ |
@@ -23,7 +23,7 @@ | |||
#include <optional> | #include <optional> | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTAMDGPUTOROCDLPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -1037,8 +1037,8 @@ struct AMDGPUDPPLowerin | |||
}; | }; | ||
struct ConvertAMDGPUToR | struct ConvertAMDGPUToR | ||
- : public | + : public impl::ConvertAMDGPUToROCDLPassBase<ConvertAMDGPUToROCDLPass> { | ||
- ConvertAMDGPUToR | + using ConvertAMDGPUToR | ||
void runOnOperation() override { | void runOnOperation() override { | ||
MLIRContext *ctx = &getContext(); | MLIRContext *ctx = &getContext(); | ||
@@ -1083,7 +1083,3 @@ void mlir::populateAM | |||
PackedTrunc2xFp8 | PackedTrunc2xFp8 | ||
chipset); | chipset); | ||
} | } | ||
- | |||
-std::unique_ptr<Pass> mlir::createConvertAMD | |||
- return std::make_unique<ConvertAMDGPUToR | |||
-} |
@@ -26,7 +26,7 @@ | |||
#include "mlir/Transforms/Passes.h" | #include "mlir/Transforms/Passes.h" | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_LOWERAFFINEPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -553,8 +553,7 @@ void mlir::populateAf | |||
} | } | ||
namespace { | namespace { | ||
-class | +class LowerAffine : public impl::LowerAffinePassBase<LowerAffine> { | ||
- : public impl::ConvertAffineToS | |||
void runOnOperation() override { | void runOnOperation() override { | ||
RewritePatternSe | RewritePatternSe | ||
populateAffineTo | populateAffineTo | ||
@@ -569,9 +568,3 @@ class LowerAffinePass | |||
} | } | ||
}; | }; | ||
} // namespace | } // namespace | ||
- | |||
-/// Lowers If and For operations within a function into their lower level CFG | |||
-/// equivalent blocks. | |||
-std::unique_ptr<Pass> mlir::createLowerAffin | |||
- return std::make_unique<LowerAffinePass>(); | |||
-} |
@@ -27,7 +27,7 @@ | |||
#include <memory> | #include <memory> | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTARITHTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -1337,7 +1337,9 @@ void mlir::arith::pop | |||
namespace { | namespace { | ||
struct ConvertArithToSP | struct ConvertArithToSP | ||
- : public | + : public impl::ConvertArithToSPIRVPassBase<ConvertArithToSPIRVPass> { | ||
+ using ConvertArithToSP | |||
+ | |||
void runOnOperation() override { | void runOnOperation() override { | ||
Operation *op = getOperation(); | Operation *op = getOperation(); | ||
spirv::TargetEnvAttr targetAttr = spirv::lookupTargetEnvO | spirv::TargetEnvAttr targetAttr = spirv::lookupTargetEnvO | ||
@@ -1363,7 +1365,3 @@ struct ConvertArithToSP | |||
} | } | ||
}; | }; | ||
} // namespace | } // namespace | ||
- | |||
-std::unique_ptr<OperationPass<>> mlir::arith::createConvertAri | |||
- return std::make_unique<ConvertArithToSP | |||
-} |
@@ -16,7 +16,7 @@ | |||
#include "mlir/Transforms/GreedyPatternRew | #include "mlir/Transforms/GreedyPatternRew | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTARMNEON2DTOINTRPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -52,7 +52,7 @@ public: | |||
}; | }; | ||
class ConvertArmNeon2d | class ConvertArmNeon2d | ||
- : public | + : public impl::ConvertArmNeon2dToIntrPassBase<ConvertArmNeon2dToIntr> { | ||
void runOnOperation() override { | void runOnOperation() override { | ||
auto *context = &getContext(); | auto *context = &getContext(); | ||
@@ -69,7 +69,3 @@ class ConvertArmNeon2d | |||
void mlir::populateConvertA | void mlir::populateConvertA | ||
patterns.add<Sdot2dLoweringPa | patterns.add<Sdot2dLoweringPa | ||
} | } | ||
- | |||
-std::unique_ptr<Pass> mlir::createConvertArm | |||
- return std::make_unique<ConvertArmNeon2d | |||
-} |
@@ -19,7 +19,7 @@ | |||
#include "mlir/Transforms/DialectConversio | #include "mlir/Transforms/DialectConversio | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTARMSMETOSCFPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -397,7 +397,7 @@ void mlir::populateAr | |||
namespace { | namespace { | ||
struct ConvertArmSMEToS | struct ConvertArmSMEToS | ||
- : public | + : public impl::ConvertArmSMEToSCFPassBase<ConvertArmSMEToSCFPass> { | ||
void runOnOperation() override { | void runOnOperation() override { | ||
RewritePatternSe | RewritePatternSe | ||
ConversionTarget | ConversionTarget | ||
@@ -412,7 +412,3 @@ struct ConvertArmSMEToS | |||
}; | }; | ||
} // namespace | } // namespace | ||
- | |||
-std::unique_ptr<Pass> mlir::createConvertArm | |||
- return std::make_unique<ConvertArmSMEToS | |||
-} |
@@ -24,7 +24,7 @@ | |||
#include "mlir/Transforms/DialectConversio | #include "mlir/Transforms/DialectConversio | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTBUFFERIZATIONTOMEMREFPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -121,7 +121,8 @@ struct CloneOpConversio | |||
namespace { | namespace { | ||
struct BufferizationToM | struct BufferizationToM | ||
- : public | + : public impl::ConvertBufferizationToMemRefPassBase< | ||
+ BufferizationToM | |||
BufferizationToM | BufferizationToM | ||
void runOnOperation() override { | void runOnOperation() override { | ||
@@ -167,7 +168,3 @@ struct BufferizationToM | |||
} | } | ||
}; | }; | ||
} // namespace | } // namespace | ||
- | |||
-std::unique_ptr<Pass> mlir::createBufferizat | |||
- return std::make_unique<BufferizationToM | |||
-} |
@@ -143,8 +143,3 @@ void ConvertComplexTo | |||
if (failed(applyPartialConv | if (failed(applyPartialConv | ||
signalPassFailur | signalPassFailur | ||
} | } | ||
- | |||
-std::unique_ptr<OperationPass<ModuleOp>> | |||
-mlir::createConvertCom | |||
- return std::make_unique<ConvertComplexTo | |||
-} |
@@ -20,7 +20,7 @@ | |||
#include <type_traits> | #include <type_traits> | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTCOMPLEXTOSTANDARDPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -1070,11 +1070,9 @@ void mlir::populateCo | |||
namespace { | namespace { | ||
struct ConvertComplexTo | struct ConvertComplexTo | ||
- : public | + : public impl::ConvertComplexToStandardPassBase< | ||
- | + ConvertComplexToStandardPass> { | ||
- ConvertComplexTo | + using ConvertComplexTo | ||
- : impl::ConvertComplexTo | |||
- options) {} | |||
void runOnOperation() override; | void runOnOperation() override; | ||
}; | }; | ||
@@ -1092,12 +1090,3 @@ void ConvertComplexTo | |||
signalPassFailur | signalPassFailur | ||
} | } | ||
} // namespace | } // namespace | ||
- | |||
-std::unique_ptr<Pass> mlir::createConvertCom | |||
- return std::make_unique<ConvertComplexTo | |||
-} | |||
- | |||
-std::unique_ptr<Pass> mlir::createConvertCom | |||
- ConvertComplexTo | |||
- return std::make_unique<ConvertComplexTo | |||
-} |
@@ -17,7 +17,7 @@ | |||
#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" | #include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTCONTROLFLOWTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -26,8 +26,9 @@ using namespace mlir; | |||
namespace { | namespace { | ||
/// A pass converting MLIR ControlFlow operations into the SPIR-V dialect. | /// A pass converting MLIR ControlFlow operations into the SPIR-V dialect. | ||
class ConvertControlFl | class ConvertControlFl | ||
- : public | + : public impl::ConvertControlFlowToSPIRVPassBase< | ||
ConvertControlFl | ConvertControlFl | ||
+ using ConvertControlFl | |||
void runOnOperation() override; | void runOnOperation() override; | ||
}; | }; | ||
} // namespace | } // namespace | ||
@@ -52,7 +53,3 @@ void ConvertControlFl | |||
if (failed(applyPartialConv | if (failed(applyPartialConv | ||
return signalPassFailur | return signalPassFailur | ||
} | } | ||
- | |||
-std::unique_ptr<OperationPass<>> mlir::createConvertCon | |||
- return std::make_unique<ConvertControlFl | |||
-} |
@@ -280,7 +280,3 @@ void mlir::registerCo | |||
DialectRegistry ®istry) { | DialectRegistry ®istry) { | ||
registry.addExtensions<LoadDependentDia | registry.addExtensions<LoadDependentDia | ||
} | } | ||
- | |||
-std::unique_ptr<Pass> mlir::createConvertToL | |||
- return std::make_unique<ConvertToLLVMPas | |||
-} |
@@ -17,7 +17,7 @@ | |||
#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" | #include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTFUNCTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -26,7 +26,8 @@ using namespace mlir; | |||
namespace { | namespace { | ||
/// A pass converting MLIR Func operations into the SPIR-V dialect. | /// A pass converting MLIR Func operations into the SPIR-V dialect. | ||
class ConvertFuncToSPI | class ConvertFuncToSPI | ||
- : public | + : public impl::ConvertFuncToSPIRVPassBase<ConvertFuncToSPIRVPass> { | ||
+ using ConvertFuncToSPI | |||
void runOnOperation() override; | void runOnOperation() override; | ||
}; | }; | ||
} // namespace | } // namespace | ||
@@ -50,7 +51,3 @@ void ConvertFuncToSPI | |||
if (failed(applyPartialConv | if (failed(applyPartialConv | ||
return signalPassFailur | return signalPassFailur | ||
} | } | ||
- | |||
-std::unique_ptr<OperationPass<>> mlir::createConvertFun | |||
- return std::make_unique<ConvertFuncToSPI | |||
-} |
@@ -18,7 +18,7 @@ | |||
#include "mlir/Pass/Pass.h" | #include "mlir/Pass/Pass.h" | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTLINALGTOSTANDARDPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -133,7 +133,8 @@ void mlir::linalg::po | |||
namespace { | namespace { | ||
struct ConvertLinalgToS | struct ConvertLinalgToS | ||
- : public | + : public impl::ConvertLinalgToStandardPassBase< | ||
+ ConvertLinalgToS | |||
void runOnOperation() override; | void runOnOperation() override; | ||
}; | }; | ||
} // namespace | } // namespace | ||
@@ -150,8 +151,3 @@ void ConvertLinalgToS | |||
if (failed(applyFullConvers | if (failed(applyFullConvers | ||
signalPassFailur | signalPassFailur | ||
} | } | ||
- | |||
-std::unique_ptr<OperationPass<ModuleOp>> | |||
-mlir::createConvertLin | |||
- return std::make_unique<ConvertLinalgToS | |||
-} |
@@ -20,7 +20,7 @@ | |||
#include "mlir/Transforms/DialectConversio | #include "mlir/Transforms/DialectConversio | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTMATHTOLIBMPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -212,7 +212,7 @@ void mlir::populateMa | |||
namespace { | namespace { | ||
struct ConvertMathToLib | struct ConvertMathToLib | ||
- : public | + : public impl::ConvertMathToLibmPassBase<ConvertMathToLibmPass> { | ||
void runOnOperation() override; | void runOnOperation() override; | ||
}; | }; | ||
} // namespace | } // namespace | ||
@@ -230,7 +230,3 @@ void ConvertMathToLib | |||
if (failed(applyPartialConv | if (failed(applyPartialConv | ||
signalPassFailur | signalPassFailur | ||
} | } | ||
- | |||
-std::unique_ptr<OperationPass<ModuleOp>> mlir::createConvertMat | |||
- return std::make_unique<ConvertMathToLib | |||
-} |
@@ -15,10 +15,9 @@ | |||
#include "mlir/Conversion/MathToSPIRV/MathToSPIRV.h" | #include "mlir/Conversion/MathToSPIRV/MathToSPIRV.h" | ||
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h" | #include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h" | ||
#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" | #include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" | ||
-#include "mlir/Pass/Pass.h" | |||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTMATHTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -27,7 +26,7 @@ using namespace mlir; | |||
namespace { | namespace { | ||
/// A pass converting MLIR Math operations into the SPIR-V dialect. | /// A pass converting MLIR Math operations into the SPIR-V dialect. | ||
class ConvertMathToSPI | class ConvertMathToSPI | ||
- : public | + : public impl::ConvertMathToSPIRVPassBase<ConvertMathToSPIRVPass> { | ||
void runOnOperation() override; | void runOnOperation() override; | ||
}; | }; | ||
} // namespace | } // namespace | ||
@@ -52,7 +51,3 @@ void ConvertMathToSPI | |||
if (failed(applyPartialConv | if (failed(applyPartialConv | ||
return signalPassFailur | return signalPassFailur | ||
} | } | ||
- | |||
-std::unique_ptr<OperationPass<>> mlir::createConvertMat | |||
- return std::make_unique<ConvertMathToSPI | |||
-} |
@@ -17,7 +17,7 @@ | |||
#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" | #include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTMEMREFTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -26,7 +26,8 @@ using namespace mlir; | |||
namespace { | namespace { | ||
/// A pass converting MLIR MemRef operations into the SPIR-V dialect. | /// A pass converting MLIR MemRef operations into the SPIR-V dialect. | ||
class ConvertMemRefToS | class ConvertMemRefToS | ||
- : public | + : public impl::ConvertMemRefToSPIRVPassBase<ConvertMemRefToSPIRVPass> { | ||
+ using ConvertMemRefToS | |||
void runOnOperation() override; | void runOnOperation() override; | ||
}; | }; | ||
} // namespace | } // namespace | ||
@@ -54,7 +55,3 @@ void ConvertMemRefToS | |||
if (failed(applyPartialConv | if (failed(applyPartialConv | ||
return signalPassFailur | return signalPassFailur | ||
} | } | ||
- | |||
-std::unique_ptr<OperationPass<>> mlir::createConvertMem | |||
- return std::make_unique<ConvertMemRefToS | |||
-} |
@@ -431,8 +431,3 @@ struct ConvertMeshToMPI | |||
}; | }; | ||
} // namespace | } // namespace | ||
- | |||
-// Create a pass that convert Mesh to MPI | |||
-std::unique_ptr<::mlir::Pass> mlir::createConvertMes | |||
- return std::make_unique<ConvertMeshToMPI | |||
-} |
@@ -16,7 +16,7 @@ | |||
#include "mlir/Transforms/DialectConversio | #include "mlir/Transforms/DialectConversio | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTOPENACCTOSCFPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -66,7 +66,7 @@ void mlir::populateOp | |||
namespace { | namespace { | ||
struct ConvertOpenACCTo | struct ConvertOpenACCTo | ||
- : public | + : public impl::ConvertOpenACCToSCFPassBase<ConvertOpenACCToSCFPass> { | ||
void runOnOperation() override; | void runOnOperation() override; | ||
}; | }; | ||
} // namespace | } // namespace | ||
@@ -94,7 +94,3 @@ void ConvertOpenACCTo | |||
if (failed(applyPartialConv | if (failed(applyPartialConv | ||
signalPassFailur | signalPassFailur | ||
} | } | ||
- | |||
-std::unique_ptr<OperationPass<ModuleOp>> mlir::createConvertOpe | |||
- return std::make_unique<ConvertOpenACCTo | |||
-} |
@@ -21,7 +21,7 @@ | |||
#include "llvm/ADT/TypeSwitch.h" | #include "llvm/ADT/TypeSwitch.h" | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTPDLTOPDLINTERPPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -967,7 +967,7 @@ void PatternLowering: | |||
namespace { | namespace { | ||
struct PDLToPDLInterpPa | struct PDLToPDLInterpPa | ||
- : public | + : public impl::ConvertPDLToPDLInterpPassBase<PDLToPDLInterpPass> { | ||
PDLToPDLInterpPa | PDLToPDLInterpPa | ||
PDLToPDLInterpPa | PDLToPDLInterpPa | ||
PDLToPDLInterpPa | PDLToPDLInterpPa | ||
@@ -1013,10 +1013,7 @@ void PDLToPDLInterpPa | |||
} | } | ||
} | } | ||
-std::unique_ptr<OperationPass<ModuleOp>> | +std::unique_ptr<OperationPass<ModuleOp>> mlir::createConvertPDLToPDLInterpPass( | ||
- return std::make_unique<PDLToPDLInterpPa | |||
-} | |||
-std::unique_ptr<OperationPass<ModuleOp>> mlir::createPDLToPDLIn | |||
DenseMap<Operation *, PDLPatternConfig | DenseMap<Operation *, PDLPatternConfig | ||
return std::make_unique<PDLToPDLInterpPa | return std::make_unique<PDLToPDLInterpPa | ||
} | } |
@@ -13,7 +13,7 @@ | |||
#include "mlir/Transforms/DialectConversio | #include "mlir/Transforms/DialectConversio | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_RECONCILEUNREALIZEDCASTSPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -36,7 +36,7 @@ namespace { | |||
/// In the above example, %0 can be used instead of %3 and all cast ops are | /// In the above example, %0 can be used instead of %3 and all cast ops are | ||
/// folded away. | /// folded away. | ||
struct ReconcileUnreali | struct ReconcileUnreali | ||
- : public | + : public impl::ReconcileUnrealizedCastsPassBase<ReconcileUnrealizedCasts> { | ||
ReconcileUnreali | ReconcileUnreali | ||
void runOnOperation() override { | void runOnOperation() override { | ||
@@ -48,7 +48,3 @@ struct ReconcileUnreali | |||
}; | }; | ||
} // namespace | } // namespace | ||
- | |||
-std::unique_ptr<Pass> mlir::createReconcileU | |||
- return std::make_unique<ReconcileUnreali | |||
-} |
@@ -27,7 +27,7 @@ | |||
#include "mlir/Transforms/Passes.h" | #include "mlir/Transforms/Passes.h" | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_SCFTOCONTROLFLOWPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -37,7 +37,7 @@ using namespace mlir::scf; | |||
namespace { | namespace { | ||
struct SCFToControlFlow | struct SCFToControlFlow | ||
- : public | + : public impl::SCFToControlFlowPassBase<SCFToControlFlowPass> { | ||
void runOnOperation() override; | void runOnOperation() override; | ||
}; | }; | ||
@@ -726,7 +726,3 @@ void SCFToControlFlow | |||
applyPartialConv | applyPartialConv | ||
signalPassFailur | signalPassFailur | ||
} | } | ||
- | |||
-std::unique_ptr<Pass> mlir::createConvertSCF | |||
- return std::make_unique<SCFToControlFlow | |||
-} |
@@ -20,8 +20,8 @@ | |||
#include "llvm/Support/CommandLine.h" | #include "llvm/Support/CommandLine.h" | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTAFFINEFORTOGPUPASS | ||
-#define | +#define GEN_PASS_DEF_CONVERTPARALLELLOOPTOGPUPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -32,12 +32,9 @@ namespace { | |||
// A pass that traverses top-level loops in the function and converts them to | // A pass that traverses top-level loops in the function and converts them to | ||
// GPU launch operations. Nested launches are not allowed, so this does not | // GPU launch operations. Nested launches are not allowed, so this does not | ||
// walk the function recursively to avoid considering nested loops. | // walk the function recursively to avoid considering nested loops. | ||
-struct ForLoopMapper | +struct ForLoopMapper | ||
- ForLoopMapper() = default; | + : public impl::ConvertAffineFor | ||
- ForLoopMapper(unsigned numBlockDims, unsigned numThreadDims) { | + using ConvertAffineFor | ||
- this->numBlockDims = numBlockDims; | |||
- this->numThreadDims = numThreadDims; | |||
- } | |||
void runOnOperation() override { | void runOnOperation() override { | ||
for (Operation &op : llvm::make_early_inc_r | for (Operation &op : llvm::make_early_inc_r | ||
@@ -52,7 +49,7 @@ struct ForLoopMapper : public impl::ConvertAff | |||
}; | }; | ||
struct ParallelLoopToGp | struct ParallelLoopToGp | ||
- : public | + : public impl::ConvertParallelLoopToGpuPassBase<ParallelLoopToGpuPass> { | ||
void runOnOperation() override { | void runOnOperation() override { | ||
RewritePatternSe | RewritePatternSe | ||
populateParallel | populateParallel | ||
@@ -67,16 +64,3 @@ struct ParallelLoopToGp | |||
}; | }; | ||
} // namespace | } // namespace | ||
- | |||
-std::unique_ptr<InterfacePass<FunctionOpInterf | |||
-mlir::createAffineForT | |||
- return std::make_unique<ForLoopMapper>(numBlockDims, numThreadDims); | |||
-} | |||
-std::unique_ptr<InterfacePass<FunctionOpInterf | |||
-mlir::createAffineForT | |||
- return std::make_unique<ForLoopMapper>(); | |||
-} | |||
- | |||
-std::unique_ptr<Pass> mlir::createParallelLo | |||
- return std::make_unique<ParallelLoopToGp | |||
-} |
@@ -18,7 +18,7 @@ | |||
#include "mlir/Transforms/GreedyPatternRew | #include "mlir/Transforms/GreedyPatternRew | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTSHAPECONSTRAINTSPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -54,7 +54,7 @@ namespace { | |||
// is emitted, witnesses are satisfied, so they are replace with | // is emitted, witnesses are satisfied, so they are replace with | ||
// `shape.const_witness true`. | // `shape.const_witness true`. | ||
class ConvertShapeCons | class ConvertShapeCons | ||
- : public | + : public impl::ConvertShapeConstraintsPassBase<ConvertShapeConstraints> { | ||
void runOnOperation() override { | void runOnOperation() override { | ||
auto *func = getOperation(); | auto *func = getOperation(); | ||
auto *context = &getContext(); | auto *context = &getContext(); | ||
@@ -67,7 +67,3 @@ class ConvertShapeCons | |||
} | } | ||
}; | }; | ||
} // namespace | } // namespace | ||
- | |||
-std::unique_ptr<Pass> mlir::createConvertSha | |||
- return std::make_unique<ConvertShapeCons | |||
-} |
@@ -20,7 +20,7 @@ | |||
#include "llvm/ADT/STLExtras.h" | #include "llvm/ADT/STLExtras.h" | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTSHAPETOSTANDARDPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -681,7 +681,7 @@ namespace { | |||
namespace { | namespace { | ||
/// Conversion pass. | /// Conversion pass. | ||
class ConvertShapeToSt | class ConvertShapeToSt | ||
- : public | + : public impl::ConvertShapeToStandardPassBase<ConvertShapeToStandardPass> { | ||
void runOnOperation() override; | void runOnOperation() override; | ||
}; | }; | ||
@@ -727,8 +727,3 @@ void mlir::populateSh | |||
ToExtentTensorOp | ToExtentTensorOp | ||
// clang-format on | // clang-format on | ||
} | } | ||
- | |||
-std::unique_ptr<OperationPass<ModuleOp>> | |||
-mlir::createConvertSha | |||
- return std::make_unique<ConvertShapeToSt | |||
-} |
@@ -18,7 +18,7 @@ | |||
#include "mlir/Dialect/Tensor/IR/Tensor.h" | #include "mlir/Dialect/Tensor/IR/Tensor.h" | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTTENSORTOLINALGPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -27,7 +27,7 @@ using namespace mlir; | |||
namespace { | namespace { | ||
/// A pass converting MLIR Tensor operations into the Linalg dialect. | /// A pass converting MLIR Tensor operations into the Linalg dialect. | ||
class ConvertTensorToL | class ConvertTensorToL | ||
- : public | + : public impl::ConvertTensorToLinalgPassBase<ConvertTensorToLinalgPass> { | ||
void runOnOperation() override { | void runOnOperation() override { | ||
auto &context = getContext(); | auto &context = getContext(); | ||
ConversionTarget | ConversionTarget | ||
@@ -45,8 +45,3 @@ class ConvertTensorToL | |||
} | } | ||
}; | }; | ||
} // namespace | } // namespace | ||
- | |||
-std::unique_ptr<OperationPass<ModuleOp>> | |||
-mlir::createConvertTen | |||
- return std::make_unique<ConvertTensorToL | |||
-} |
@@ -19,7 +19,7 @@ | |||
#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" | #include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTTENSORTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -28,7 +28,9 @@ using namespace mlir; | |||
namespace { | namespace { | ||
/// A pass converting MLIR Tensor operations into the SPIR-V dialect. | /// A pass converting MLIR Tensor operations into the SPIR-V dialect. | ||
class ConvertTensorToS | class ConvertTensorToS | ||
- : public | + : public impl::ConvertTensorToSPIRVPassBase<ConvertTensorToSPIRVPass> { | ||
+ using ConvertTensorToS | |||
+ | |||
void runOnOperation() override { | void runOnOperation() override { | ||
MLIRContext *context = &getContext(); | MLIRContext *context = &getContext(); | ||
Operation *op = getOperation(); | Operation *op = getOperation(); | ||
@@ -53,7 +55,3 @@ class ConvertTensorToS | |||
} | } | ||
}; | }; | ||
} // namespace | } // namespace | ||
- | |||
-std::unique_ptr<OperationPass<>> mlir::createConvertTen | |||
- return std::make_unique<ConvertTensorToS | |||
-} |
@@ -21,7 +21,7 @@ | |||
#include "mlir/Transforms/GreedyPatternRew | #include "mlir/Transforms/GreedyPatternRew | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_TOSATOARITHPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -29,9 +29,8 @@ using namespace mlir; | |||
using namespace tosa; | using namespace tosa; | ||
namespace { | namespace { | ||
-struct TosaToArith : public | +struct TosaToArith : public impl::TosaToArithPassBase<TosaToArith> { | ||
-public: | + using TosaToArithPassB | ||
- TosaToArith(TosaToArithOptio | |||
void runOnOperation() override { | void runOnOperation() override { | ||
RewritePatternSe | RewritePatternSe | ||
@@ -53,9 +52,3 @@ public: | |||
} | } | ||
}; | }; | ||
} // namespace | } // namespace | ||
- | |||
-std::unique_ptr<Pass> mlir::tosa::createTosaToArit | |||
- bool use32BitApplyRes | |||
- TosaToArithOptio | |||
- return std::make_unique<TosaToArith>(options); | |||
-} |
@@ -23,7 +23,7 @@ | |||
#include "mlir/Transforms/GreedyPatternRew | #include "mlir/Transforms/GreedyPatternRew | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_TOSATOSCFPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -31,7 +31,7 @@ using namespace mlir; | |||
using namespace tosa; | using namespace tosa; | ||
namespace { | namespace { | ||
-struct TosaToSCF : public | +struct TosaToSCF : public impl::TosaToSCFPassBase<TosaToSCF> { | ||
public: | public: | ||
void runOnOperation() override { | void runOnOperation() override { | ||
RewritePatternSe | RewritePatternSe | ||
@@ -48,10 +48,6 @@ public: | |||
}; | }; | ||
} // namespace | } // namespace | ||
-std::unique_ptr<Pass> mlir::tosa::createTosaToSCF() { | |||
- return std::make_unique<TosaToSCF>(); | |||
-} | |||
- | |||
void mlir::tosa::addTosaToSCFPass | void mlir::tosa::addTosaToSCFPass | ||
- pm.addNestedPass<func::FuncOp>( | + pm.addNestedPass<func::FuncOp>(createTosaToSCFPass()); | ||
} | } |
@@ -22,7 +22,7 @@ | |||
#include "mlir/Transforms/GreedyPatternRew | #include "mlir/Transforms/GreedyPatternRew | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_TOSATOTENSORPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -30,7 +30,7 @@ using namespace mlir; | |||
using namespace tosa; | using namespace tosa; | ||
namespace { | namespace { | ||
-struct TosaToTensor : public | +struct TosaToTensor : public impl::TosaToTensorPassBase<TosaToTensor> { | ||
public: | public: | ||
void runOnOperation() override { | void runOnOperation() override { | ||
RewritePatternSe | RewritePatternSe | ||
@@ -53,7 +53,3 @@ public: | |||
} | } | ||
}; | }; | ||
} // namespace | } // namespace | ||
- | |||
-std::unique_ptr<Pass> mlir::tosa::createTosaToTens | |||
- return std::make_unique<TosaToTensor>(); | |||
-} |
@@ -14,7 +14,7 @@ | |||
#include "mlir/Transforms/GreedyPatternRew | #include "mlir/Transforms/GreedyPatternRew | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTVECTORTOARMSMEPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -23,7 +23,7 @@ using namespace mlir::vector; | |||
namespace { | namespace { | ||
struct ConvertVectorToA | struct ConvertVectorToA | ||
- : public | + : public impl::ConvertVectorToArmSMEPassBase<ConvertVectorToArmSMEPass> { | ||
void runOnOperation() override; | void runOnOperation() override; | ||
}; | }; | ||
@@ -35,7 +35,3 @@ void ConvertVectorToA | |||
(void)applyPatternsGre | (void)applyPatternsGre | ||
} | } | ||
- | |||
-std::unique_ptr<Pass> mlir::createConvertVec | |||
- return std::make_unique<ConvertVectorToA | |||
-} |
@@ -21,7 +21,7 @@ | |||
#include "mlir/Transforms/DialectConversio | #include "mlir/Transforms/DialectConversio | ||
namespace mlir { | namespace mlir { | ||
-#define | +#define GEN_PASS_DEF_CONVERTVECTORTOSPIRVPASS | ||
#include "mlir/Conversion/Passes.h.inc" | #include "mlir/Conversion/Passes.h.inc" | ||
} // namespace mlir | } // namespace mlir | ||
@@ -29,7 +29,7 @@ using namespace mlir; | |||
namespace { | namespace { | ||
struct ConvertVectorToS | struct ConvertVectorToS | ||
- : public | + : public impl::ConvertVectorToSPIRVPassBase<ConvertVectorToSPIRVPass> { | ||
void runOnOperation() override; | void runOnOperation() override; | ||
}; | }; | ||
} // namespace | } // namespace | ||
@@ -56,7 +56,3 @@ void ConvertVectorToS | |||
if (failed(applyPartialConv | if (failed(applyPartialConv | ||
return signalPassFailur | return signalPassFailur | ||
} | } | ||
- | |||
-std::unique_ptr<OperationPass<>> mlir::createConvertVec | |||
- return std::make_unique<ConvertVectorToS | |||
-} |
@@ -329,7 +329,3 @@ void mlir::populateVe | |||
patterns.add<TransferReadLowe | patterns.add<TransferReadLowe | ||
StoreLowering>(patterns.getContext()); | StoreLowering>(patterns.getContext()); | ||
} | } | ||
- | |||
-std::unique_ptr<Pass> mlir::createConvertVec | |||
- return std::make_unique<ConvertVectorToX | |||
-} |
@@ -48,7 +48,7 @@ void buildCommonPassP | |||
pm.addPass(createConvertNVG | pm.addPass(createConvertNVG | ||
pm.addPass(createGpuKernelO | pm.addPass(createGpuKernelO | ||
pm.addPass(createConvertVec | pm.addPass(createConvertVec | ||
- pm.addPass( | + pm.addPass(createSCFToControlFlowPass()); | ||
pm.addPass(createConvertNVV | pm.addPass(createConvertNVV | ||
pm.addPass(createConvertFun | pm.addPass(createConvertFun | ||
pm.addPass(memref::createExpandStri | pm.addPass(memref::createExpandStri |
@@ -55,7 +55,7 @@ void mlir::sparse_ten | |||
if (gpuCodegen) { | if (gpuCodegen) { | ||
pm.addPass(createSparseGPUC | pm.addPass(createSparseGPUC | ||
pm.addNestedPass<gpu::GPUModuleOp>(createStripDebug | pm.addNestedPass<gpu::GPUModuleOp>(createStripDebug | ||
- pm.addNestedPass<gpu::GPUModuleOp>( | + pm.addNestedPass<gpu::GPUModuleOp>(createSCFToControlFlowPass()); | ||
pm.addNestedPass<gpu::GPUModuleOp>(createConvertGpu | pm.addNestedPass<gpu::GPUModuleOp>(createConvertGpu | ||
} | } | ||
@@ -66,7 +66,7 @@ void mlir::sparse_ten | |||
pm.addNestedPass<func::FuncOp>(createConvertLin | pm.addNestedPass<func::FuncOp>(createConvertLin | ||
pm.addNestedPass<func::FuncOp>(createConvertVec | pm.addNestedPass<func::FuncOp>(createConvertVec | ||
pm.addNestedPass<func::FuncOp>(memref::createExpandReal | pm.addNestedPass<func::FuncOp>(memref::createExpandReal | ||
- pm.addNestedPass<func::FuncOp>( | + pm.addNestedPass<func::FuncOp>(createSCFToControlFlowPass()); | ||
pm.addPass(memref::createExpandStri | pm.addPass(memref::createExpandStri | ||
pm.addPass(createLowerAffin | pm.addPass(createLowerAffin | ||
pm.addPass( | pm.addPass( | ||
@@ -76,7 +76,7 @@ void mlir::sparse_ten | |||
pm.addNestedPass<func::FuncOp>(arith::createArithExpan | pm.addNestedPass<func::FuncOp>(arith::createArithExpan | ||
pm.addNestedPass<func::FuncOp>(createConvertMat | pm.addNestedPass<func::FuncOp>(createConvertMat | ||
pm.addPass(createConvertMat | pm.addPass(createConvertMat | ||
- pm.addPass( | + pm.addPass(createConvertComplexToLibm()); | ||
pm.addPass( | pm.addPass( | ||
createConvertVec | createConvertVec | ||
pm.addPass(createConvertCom | pm.addPass(createConvertCom |
@@ -43,7 +43,7 @@ convertPDLToPDLI | |||
// mode. | // mode. | ||
pdlPipeline.enableVerifier(false); | pdlPipeline.enableVerifier(false); | ||
#endif | #endif | ||
- pdlPipeline.addPass( | + pdlPipeline.addPass(createConvertPDLToPDLInterpPass(configMap)); | ||
if (failed(pdlPipeline.run(pdlModule))) | if (failed(pdlPipeline.run(pdlModule))) | ||
return failure(); | return failure(); | ||
@@ -77,7 +77,7 @@ void buildTestLowerTo | |||
/*ifRequiredByOps=*/true)); | /*ifRequiredByOps=*/true)); | ||
// Convert SCF to CF (required for ArmSME tile allocation). | // Convert SCF to CF (required for ArmSME tile allocation). | ||
- pm.addPass( | + pm.addPass(createSCFToControlFlowPass()); | ||
// Convert ArmSME to LLVM. | // Convert ArmSME to LLVM. | ||
pm.addNestedPass<func::FuncOp>( | pm.addNestedPass<func::FuncOp>( |
@@ -55,7 +55,7 @@ void buildTestLowerTo | |||
// Blanket-convert any remaining affine ops if any remain. | // Blanket-convert any remaining affine ops if any remain. | ||
pm.addPass(createLowerAffin | pm.addPass(createLowerAffin | ||
// Convert SCF to CF (always needed). | // Convert SCF to CF (always needed). | ||
- pm.addPass( | + pm.addPass(createSCFToControlFlowPass()); | ||
// Sprinkle some cleanups. | // Sprinkle some cleanups. | ||
pm.addPass(createCanonicali | pm.addPass(createCanonicali | ||
pm.addPass(createCSEPass()); | pm.addPass(createCSEPass()); |