-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[MLIR][NFC] Retire let constructor
for passes in Conversion directory (part1)
#127403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-flang-fir-hlfir @llvm/pr-subscribers-mlir-sparse Author: lorenzo chelini (chelini) Changes…art1)
Patch is 86.35 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/127403.diff 66 Files Affected:
diff --git a/mlir/include/mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h b/mlir/include/mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h
index e7637a6013e68..cc32e97084830 100644
--- a/mlir/include/mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h
+++ b/mlir/include/mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h
@@ -18,7 +18,7 @@ class LLVMTypeConverter;
class RewritePatternSet;
class Pass;
-#define GEN_PASS_DECL_CONVERTAMDGPUTOROCDL
+#define GEN_PASS_DECL_CONVERTAMDGPUTOROCDLPASS
#include "mlir/Conversion/Passes.h.inc"
/// Note: The ROCDL target does not support the LLVM bfloat type at this time
@@ -28,8 +28,6 @@ void populateAMDGPUToROCDLConversionPatterns(const LLVMTypeConverter &converter,
RewritePatternSet &patterns,
amdgpu::Chipset chipset);
-std::unique_ptr<Pass> createConvertAMDGPUToROCDLPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_AMDGPUTOROCDL_AMDGPUTOROCDL_H_
diff --git a/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h
index 96ee4f0255d9a..893c2455fa587 100644
--- a/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h
+++ b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h
@@ -24,7 +24,7 @@ namespace affine {
class AffineForOp;
} // namespace affine
-#define GEN_PASS_DECL_CONVERTAFFINETOSTANDARD
+#define GEN_PASS_DECL_LOWERAFFINE
#include "mlir/Conversion/Passes.h.inc"
/// Collect a set of patterns to convert from the Affine dialect to the Standard
diff --git a/mlir/include/mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h b/mlir/include/mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h
index a15e56bfdf04b..1a6ba1cf0db08 100644
--- a/mlir/include/mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h
+++ b/mlir/include/mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h
@@ -18,7 +18,7 @@ class SPIRVTypeConverter;
class RewritePatternSet;
class Pass;
-#define GEN_PASS_DECL_CONVERTARITHTOSPIRV
+#define GEN_PASS_DECL_CONVERTARITHTOSPIRVPASS
#include "mlir/Conversion/Passes.h.inc"
namespace arith {
diff --git a/mlir/include/mlir/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.h b/mlir/include/mlir/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.h
index 7ab2b8674315f..860880bcd4a4c 100644
--- a/mlir/include/mlir/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.h
+++ b/mlir/include/mlir/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.h
@@ -15,18 +15,13 @@ namespace mlir {
class Pass;
class RewritePatternSet;
-#define GEN_PASS_DECL_CONVERTARMNEON2DTOINTR
+#define GEN_PASS_DECL_CONVERTARMNEON2DTOINTRPASS
#include "mlir/Conversion/Passes.h.inc"
/// Populates patterns for the lowering of Arm NEON 2D ops to intrinsics.
/// See createConvertArmNeon2dToIntrPass.
void populateConvertArmNeon2dToIntrPatterns(RewritePatternSet &patterns);
-/// 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> createConvertArmNeon2dToIntrPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_ARMNEON2DTOINTR_ARMNEON2DTOINTR_H_
diff --git a/mlir/include/mlir/Conversion/ArmSMEToSCF/ArmSMEToSCF.h b/mlir/include/mlir/Conversion/ArmSMEToSCF/ArmSMEToSCF.h
index 3a28ca11862af..0b9b066690b66 100644
--- a/mlir/include/mlir/Conversion/ArmSMEToSCF/ArmSMEToSCF.h
+++ b/mlir/include/mlir/Conversion/ArmSMEToSCF/ArmSMEToSCF.h
@@ -15,15 +15,12 @@ namespace mlir {
class Pass;
class RewritePatternSet;
-#define GEN_PASS_DECL_CONVERTARMSMETOSCF
+#define GEN_PASS_DECL_CONVERTARMSMETOSCFPASS
#include "mlir/Conversion/Passes.h.inc"
/// Collect a set of patterns to convert from the ArmSME dialect to SCF.
void populateArmSMEToSCFConversionPatterns(RewritePatternSet &patterns);
-/// Create a pass to convert a subset of ArmSME ops to SCF.
-std::unique_ptr<Pass> createConvertArmSMEToSCFPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_ARMSMETOSCF_ARMSMETOSCF_H_
diff --git a/mlir/include/mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h b/mlir/include/mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h
index c7146239f34b1..4beb0a5c3ec59 100644
--- a/mlir/include/mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h
+++ b/mlir/include/mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h
@@ -15,10 +15,9 @@
namespace mlir {
class ModuleOp;
-#define GEN_PASS_DECL_CONVERTBUFFERIZATIONTOMEMREF
+#define GEN_PASS_DECL_CONVERTBUFFERIZATIONTOMEMREFPASS
#include "mlir/Conversion/Passes.h.inc"
-std::unique_ptr<Pass> createBufferizationToMemRefPass();
} // namespace mlir
#endif // MLIR_CONVERSION_BUFFERIZATIONTOMEMREF_BUFFERIZATIONTOMEMREF_H
diff --git a/mlir/include/mlir/Conversion/ComplexToLibm/ComplexToLibm.h b/mlir/include/mlir/Conversion/ComplexToLibm/ComplexToLibm.h
index 49d9f251eec99..475d0f3ce610b 100644
--- a/mlir/include/mlir/Conversion/ComplexToLibm/ComplexToLibm.h
+++ b/mlir/include/mlir/Conversion/ComplexToLibm/ComplexToLibm.h
@@ -8,6 +8,7 @@
#ifndef MLIR_CONVERSION_COMPLEXTOLIBM_COMPLEXTOLIBM_H_
#define MLIR_CONVERSION_COMPLEXTOLIBM_COMPLEXTOLIBM_H_
+#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
namespace mlir {
@@ -22,9 +23,6 @@ class OperationPass;
void populateComplexToLibmConversionPatterns(RewritePatternSet &patterns,
PatternBenefit benefit);
-/// Create a pass to convert Complex operations to libm calls.
-std::unique_ptr<OperationPass<ModuleOp>> createConvertComplexToLibmPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_COMPLEXTOLIBM_COMPLEXTOLIBM_H_
diff --git a/mlir/include/mlir/Conversion/ComplexToStandard/ComplexToStandard.h b/mlir/include/mlir/Conversion/ComplexToStandard/ComplexToStandard.h
index 30b86cac9cd4e..509a68314f987 100644
--- a/mlir/include/mlir/Conversion/ComplexToStandard/ComplexToStandard.h
+++ b/mlir/include/mlir/Conversion/ComplexToStandard/ComplexToStandard.h
@@ -16,7 +16,7 @@ namespace mlir {
class RewritePatternSet;
class Pass;
-#define GEN_PASS_DECL_CONVERTCOMPLEXTOSTANDARD
+#define GEN_PASS_DECL_CONVERTCOMPLEXTOSTANDARDPASS
#include "mlir/Conversion/Passes.h.inc"
/// Populate the given list with patterns that convert from Complex to Standard.
@@ -25,11 +25,6 @@ void populateComplexToStandardConversionPatterns(
mlir::complex::ComplexRangeFlags complexRange =
mlir::complex::ComplexRangeFlags::improved);
-/// Create a pass to convert Complex operations to the Standard dialect.
-std::unique_ptr<Pass> createConvertComplexToStandardPass();
-std::unique_ptr<Pass>
-createConvertComplexToStandardPass(ConvertComplexToStandardOptions options);
-
} // namespace mlir
#endif // MLIR_CONVERSION_COMPLEXTOSTANDARD_COMPLEXTOSTANDARD_H_
diff --git a/mlir/include/mlir/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRVPass.h b/mlir/include/mlir/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRVPass.h
index 929e99d7484d9..eb8c79291e367 100644
--- a/mlir/include/mlir/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRVPass.h
@@ -18,12 +18,9 @@
namespace mlir {
class ModuleOp;
-#define GEN_PASS_DECL_CONVERTCONTROLFLOWTOSPIRV
+#define GEN_PASS_DECL_CONVERTCONTROLFLOWTOSPIRVPASS
#include "mlir/Conversion/Passes.h.inc"
-/// Creates a pass to convert ControlFlow ops to SPIR-V ops.
-std::unique_ptr<OperationPass<>> createConvertControlFlowToSPIRVPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_CONTROLFLOWTOSPIRV_CONTROLFLOWTOSPIRVPASS_H
diff --git a/mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMPass.h b/mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMPass.h
index 73deef49c4175..7de03500f8aaa 100644
--- a/mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMPass.h
+++ b/mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMPass.h
@@ -13,14 +13,10 @@
#include "mlir/Pass/Pass.h"
-#define GEN_PASS_DECL_CONVERTTOLLVMPASS
-#include "mlir/Conversion/Passes.h.inc"
-
namespace mlir {
-/// Create a pass that performs dialect conversion to LLVM for all dialects
-/// implementing `ConvertToLLVMPatternInterface`.
-std::unique_ptr<Pass> createConvertToLLVMPass();
+#define GEN_PASS_DECL_CONVERTTOLLVMPASS
+#include "mlir/Conversion/Passes.h.inc"
/// Register the extension that will load dependent dialects for LLVM
/// conversion. This is useful to implement a pass similar to "convert-to-llvm".
diff --git a/mlir/include/mlir/Conversion/FuncToSPIRV/FuncToSPIRVPass.h b/mlir/include/mlir/Conversion/FuncToSPIRV/FuncToSPIRVPass.h
index aa69b79df8c0e..d903e8e20bc1e 100644
--- a/mlir/include/mlir/Conversion/FuncToSPIRV/FuncToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/FuncToSPIRV/FuncToSPIRVPass.h
@@ -18,12 +18,9 @@
namespace mlir {
class ModuleOp;
-#define GEN_PASS_DECL_CONVERTFUNCTOSPIRV
+#define GEN_PASS_DECL_CONVERTFUNCTOSPIRVPASS
#include "mlir/Conversion/Passes.h.inc"
-/// Creates a pass to convert Func ops to SPIR-V ops.
-std::unique_ptr<OperationPass<>> createConvertFuncToSPIRVPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_FUNCTOSPIRV_FUNCTOSPIRVPASS_H
diff --git a/mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h b/mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
index eefa2c4724833..51b14953a95a7 100644
--- a/mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
+++ b/mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
@@ -10,6 +10,7 @@
#define MLIR_CONVERSION_LINALGTOSTANDARD_LINALGTOSTANDARD_H_
#include "mlir/Dialect/Linalg/IR/Linalg.h"
+#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
namespace mlir {
@@ -17,7 +18,7 @@ class ModuleOp;
template <typename T>
class OperationPass;
-#define GEN_PASS_DECL_CONVERTLINALGTOSTANDARD
+#define GEN_PASS_DECL_CONVERTLINALGTOSTANDARDPASS
#include "mlir/Conversion/Passes.h.inc"
namespace linalg {
@@ -46,10 +47,6 @@ class LinalgOpToLibraryCallRewrite
void populateLinalgToStandardConversionPatterns(RewritePatternSet &patterns);
} // namespace linalg
-
-/// Create a pass to convert Linalg operations to the Standard dialect.
-std::unique_ptr<OperationPass<ModuleOp>> createConvertLinalgToStandardPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_LINALGTOSTANDARD_LINALGTOSTANDARD_H_
diff --git a/mlir/include/mlir/Conversion/MathToLibm/MathToLibm.h b/mlir/include/mlir/Conversion/MathToLibm/MathToLibm.h
index 8ace53a0fd582..75f077d9ab286 100644
--- a/mlir/include/mlir/Conversion/MathToLibm/MathToLibm.h
+++ b/mlir/include/mlir/Conversion/MathToLibm/MathToLibm.h
@@ -9,12 +9,13 @@
#define MLIR_CONVERSION_MATHTOLIBM_MATHTOLIBM_H_
#include "mlir/IR/PatternMatch.h"
+#include "mlir/Pass/Pass.h"
namespace mlir {
template <typename T>
class OperationPass;
-#define GEN_PASS_DECL_CONVERTMATHTOLIBM
+#define GEN_PASS_DECL_CONVERTMATHTOLIBMPASS
#include "mlir/Conversion/Passes.h.inc"
/// Populate the given list with patterns that convert from Math to Libm calls.
@@ -22,9 +23,6 @@ class OperationPass;
void populateMathToLibmConversionPatterns(RewritePatternSet &patterns,
PatternBenefit benefit = 1);
-/// Create a pass to convert Math operations to libm calls.
-std::unique_ptr<OperationPass<ModuleOp>> createConvertMathToLibmPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_MATHTOLIBM_MATHTOLIBM_H_
diff --git a/mlir/include/mlir/Conversion/MathToSPIRV/MathToSPIRVPass.h b/mlir/include/mlir/Conversion/MathToSPIRV/MathToSPIRVPass.h
index ea0f1d3fa3589..bd6431ad84623 100644
--- a/mlir/include/mlir/Conversion/MathToSPIRV/MathToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/MathToSPIRV/MathToSPIRVPass.h
@@ -18,12 +18,9 @@
namespace mlir {
class ModuleOp;
-#define GEN_PASS_DECL_CONVERTMATHTOSPIRV
+#define GEN_PASS_DECL_CONVERTMATHTOSPIRVPASS
#include "mlir/Conversion/Passes.h.inc"
-/// Creates a pass to convert Math ops to SPIR-V ops.
-std::unique_ptr<OperationPass<>> createConvertMathToSPIRVPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_MATHTOSPIRV_MATHTOSPIRVPASS_H
diff --git a/mlir/include/mlir/Conversion/MemRefToSPIRV/MemRefToSPIRVPass.h b/mlir/include/mlir/Conversion/MemRefToSPIRV/MemRefToSPIRVPass.h
index 2cb90bac9bc78..3df54fd8a47bd 100644
--- a/mlir/include/mlir/Conversion/MemRefToSPIRV/MemRefToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/MemRefToSPIRV/MemRefToSPIRVPass.h
@@ -20,16 +20,13 @@ namespace mlir {
class ModuleOp;
#define GEN_PASS_DECL_MAPMEMREFSTORAGECLASS
-#define GEN_PASS_DECL_CONVERTMEMREFTOSPIRV
+#define GEN_PASS_DECL_CONVERTMEMREFTOSPIRVPASS
#include "mlir/Conversion/Passes.h.inc"
/// Creates a pass to map numeric MemRef memory spaces to symbolic SPIR-V
/// storage classes. The mapping is read from the command-line option.
std::unique_ptr<OperationPass<>> createMapMemRefStorageClassPass();
-/// Creates a pass to convert MemRef ops to SPIR-V ops.
-std::unique_ptr<OperationPass<>> createConvertMemRefToSPIRVPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_MEMREFTOSPIRV_MEMREFTOSPIRVPASS_H
diff --git a/mlir/include/mlir/Conversion/MeshToMPI/MeshToMPI.h b/mlir/include/mlir/Conversion/MeshToMPI/MeshToMPI.h
index 44a1cc0adb6a0..bc64e7a3c1c8c 100644
--- a/mlir/include/mlir/Conversion/MeshToMPI/MeshToMPI.h
+++ b/mlir/include/mlir/Conversion/MeshToMPI/MeshToMPI.h
@@ -18,10 +18,6 @@ class Pass;
#define GEN_PASS_DECL_CONVERTMESHTOMPIPASS
#include "mlir/Conversion/Passes.h.inc"
-/// Lowers Mesh communication operations (updateHalo, AllGater, ...)
-/// to MPI primitives.
-std::unique_ptr<::mlir::Pass> createConvertMeshToMPIPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_MESHTOMPI_MESHTOMPI_H
diff --git a/mlir/include/mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h b/mlir/include/mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h
index 44a58667b7a9a..75ded320e2f9e 100644
--- a/mlir/include/mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h
+++ b/mlir/include/mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h
@@ -8,6 +8,7 @@
#ifndef MLIR_CONVERSION_OPENACCTOSCF_CONVERTOPENACCTOSCF_H
#define MLIR_CONVERSION_OPENACCTOSCF_CONVERTOPENACCTOSCF_H
+#include "mlir/Pass/Pass.h"
#include <memory>
namespace mlir {
@@ -16,16 +17,13 @@ template <typename T>
class OperationPass;
class RewritePatternSet;
-#define GEN_PASS_DECL_CONVERTOPENACCTOSCF
+#define GEN_PASS_DECL_CONVERTOPENACCTOSCFPASS
#include "mlir/Conversion/Passes.h.inc"
/// Collect the patterns to convert from the OpenACC dialect to OpenACC with
/// SCF dialect.
void populateOpenACCToSCFConversionPatterns(RewritePatternSet &patterns);
-/// Create a pass to convert the OpenACC dialect into the LLVMIR dialect.
-std::unique_ptr<OperationPass<ModuleOp>> createConvertOpenACCToSCFPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_OPENACCTOSCF_CONVERTOPENACCTOSCF_H
diff --git a/mlir/include/mlir/Conversion/PDLToPDLInterp/PDLToPDLInterp.h b/mlir/include/mlir/Conversion/PDLToPDLInterp/PDLToPDLInterp.h
index 54033ff1639c7..c6a647245f82b 100644
--- a/mlir/include/mlir/Conversion/PDLToPDLInterp/PDLToPDLInterp.h
+++ b/mlir/include/mlir/Conversion/PDLToPDLInterp/PDLToPDLInterp.h
@@ -13,6 +13,7 @@
#ifndef MLIR_CONVERSION_PDLTOPDLINTERP_PDLTOPDLINTERP_H
#define MLIR_CONVERSION_PDLTOPDLINTERP_PDLTOPDLINTERP_H
+#include "mlir/Pass/Pass.h"
#include "mlir/Support/LLVM.h"
namespace mlir {
@@ -22,16 +23,13 @@ template <typename OpT>
class OperationPass;
class PDLPatternConfigSet;
-#define GEN_PASS_DECL_CONVERTPDLTOPDLINTERP
+#define GEN_PASS_DECL_CONVERTPDLTOPDLINTERPPASS
#include "mlir/Conversion/Passes.h.inc"
-/// Creates and returns a pass to convert PDL ops to PDL interpreter ops.
-std::unique_ptr<OperationPass<ModuleOp>> createPDLToPDLInterpPass();
-
/// Creates and returns a pass to convert PDL ops to PDL interpreter ops.
/// `configMap` holds a map of the configurations for each pattern being
/// compiled.
-std::unique_ptr<OperationPass<ModuleOp>> createPDLToPDLInterpPass(
+std::unique_ptr<OperationPass<ModuleOp>> createConvertPDLToPDLInterpPass(
DenseMap<Operation *, PDLPatternConfigSet *> &configMap);
} // namespace mlir
diff --git a/mlir/include/mlir/Conversion/Passes.td b/mlir/include/mlir/Conversion/Passes.td
index af46975b0213e..0479f32c85341 100644
--- a/mlir/include/mlir/Conversion/Passes.td
+++ b/mlir/include/mlir/Conversion/Passes.td
@@ -30,7 +30,6 @@ def ConvertToLLVMPass : Pass<"convert-to-llvm"> {
extra overhead.
}];
- let constructor = "mlir::createConvertToLLVMPass()";
let options = [
ListOption<"filterDialects", "filter-dialects", "std::string",
"Test conversion patterns of only the specified dialects">,
@@ -40,11 +39,11 @@ def ConvertToLLVMPass : Pass<"convert-to-llvm"> {
}
//===----------------------------------------------------------------------===//
-// AffineToStandard
+// LowerAffine
//===----------------------------------------------------------------------===//
-def ConvertAffineToStandard : Pass<"lower-affine"> {
- let summary = "Lower Affine operations to a combination of Standard and SCF "
+def LowerAffine : Pass<"lower-affine"> {
+ let summary = "Lower Affine operations to a combination of Arith and SCF "
"operations";
let description = [{
@@ -55,7 +54,7 @@ def ConvertAffineToStandard : Pass<"lower-affine"> {
of certain structural restrictions (on their bounds and step). `affine.if`
is similarly converted to the `scf.if` operation. `affine.apply` operations
are converted into sequences of primitive arithmetic operations from the
- standard dialect that have the same effect, using operands of the `index`
+ 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
removed from the module.
@@ -93,24 +92,19 @@ def ConvertAffineToStandard : Pass<"lower-affine"> {
if they do not depend on the loop iterator value or on the result of
`affine.apply`.
}];
- let constructor = "mlir::createLowerAffinePass()";
- let dependentDialects = [
- "memref::MemRefDialect",
- "scf::SCFDialect",
- "vector::VectorDialect"
- ];
+ let dependentDialects = ["arith::ArithDialect", "memref::MemRefDialect",
+ "scf::SCFDialect", "vector::VectorDialect"];
}
//===----------------------------------------------------------------------===//
// AMDGPUToROCDL
//===----------------------------------------------------------------------===//
-def ConvertAMDGPUToROCDL : Pass<"convert-amdgpu-to-rocdl"> {
+def ConvertAMDGPUToROCDLPass : Pass<"convert-amdgpu-to-rocdl"> {
let summary = "Convert AMDGPU dialect to ROCDL dialect";
let description = [{
This pass converts supported AMDGPU ops to ROCDL dialect intrinsics.
}];
- let constructor = "mlir::createConvertAMDGPUToROCDLPass()";
let dependentDialects = [
"LLVM::LLVMDialect",
"ROCDL::ROCDLDialect",
@@ -177,9 +171,8 @@ def ArithToLLVMConversionPass : Pass<"convert-arith-to-llvm"> {
// ArithToSPIRV
//===----------------------------------------------------------------------===//
-def ConvertArithToSPIRV : Pass<"convert-arith-to-spirv"> {
+def ConvertArithToSPIRVPass : Pass<"convert-arith-to-spirv"> {
let summary = "Convert Arith dialect to SPIR-V dialect";
- let constructor = "mlir::arith::createConvertArithToSPIRVPass()";
let dependentDialects = ["spirv::SPIRVDialect"];
let options = [
Option<"emulateLT32BitScalarTypes", "emulate-lt-32-bit-scalar-types",
@@ -202,9 +195,13 @@ def ArithToArmSMEConversionPass : Pass<"convert-arith-to-arm-sme"> {
// ArmNeon2dToIntr
//===----------------------------------------------------------------------===//
-def ConvertArmNeon2dToIntr : Pass<"arm-neon-2d-to-intr"> {
+def ConvertArmNeon2dToIntrPass : Pass<"arm-neon-2d-to-intr"> {
let summary = "Convert Arm NEON structured ops to intrinsics";
- let constructor = "mlir::createConvertArmNeon2dToIntrPass()";
+ 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 dependentDialects = ["arm_neon::ArmNeonDialect", "vector::VectorDialect"];
}
@@ -231,7 +228,7 @...
[truncated]
|
@llvm/pr-subscribers-mlir-llvm Author: lorenzo chelini (chelini) Changes…art1)
Patch is 86.35 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/127403.diff 66 Files Affected:
diff --git a/mlir/include/mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h b/mlir/include/mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h
index e7637a6013e68..cc32e97084830 100644
--- a/mlir/include/mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h
+++ b/mlir/include/mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h
@@ -18,7 +18,7 @@ class LLVMTypeConverter;
class RewritePatternSet;
class Pass;
-#define GEN_PASS_DECL_CONVERTAMDGPUTOROCDL
+#define GEN_PASS_DECL_CONVERTAMDGPUTOROCDLPASS
#include "mlir/Conversion/Passes.h.inc"
/// Note: The ROCDL target does not support the LLVM bfloat type at this time
@@ -28,8 +28,6 @@ void populateAMDGPUToROCDLConversionPatterns(const LLVMTypeConverter &converter,
RewritePatternSet &patterns,
amdgpu::Chipset chipset);
-std::unique_ptr<Pass> createConvertAMDGPUToROCDLPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_AMDGPUTOROCDL_AMDGPUTOROCDL_H_
diff --git a/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h
index 96ee4f0255d9a..893c2455fa587 100644
--- a/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h
+++ b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h
@@ -24,7 +24,7 @@ namespace affine {
class AffineForOp;
} // namespace affine
-#define GEN_PASS_DECL_CONVERTAFFINETOSTANDARD
+#define GEN_PASS_DECL_LOWERAFFINE
#include "mlir/Conversion/Passes.h.inc"
/// Collect a set of patterns to convert from the Affine dialect to the Standard
diff --git a/mlir/include/mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h b/mlir/include/mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h
index a15e56bfdf04b..1a6ba1cf0db08 100644
--- a/mlir/include/mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h
+++ b/mlir/include/mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h
@@ -18,7 +18,7 @@ class SPIRVTypeConverter;
class RewritePatternSet;
class Pass;
-#define GEN_PASS_DECL_CONVERTARITHTOSPIRV
+#define GEN_PASS_DECL_CONVERTARITHTOSPIRVPASS
#include "mlir/Conversion/Passes.h.inc"
namespace arith {
diff --git a/mlir/include/mlir/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.h b/mlir/include/mlir/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.h
index 7ab2b8674315f..860880bcd4a4c 100644
--- a/mlir/include/mlir/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.h
+++ b/mlir/include/mlir/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.h
@@ -15,18 +15,13 @@ namespace mlir {
class Pass;
class RewritePatternSet;
-#define GEN_PASS_DECL_CONVERTARMNEON2DTOINTR
+#define GEN_PASS_DECL_CONVERTARMNEON2DTOINTRPASS
#include "mlir/Conversion/Passes.h.inc"
/// Populates patterns for the lowering of Arm NEON 2D ops to intrinsics.
/// See createConvertArmNeon2dToIntrPass.
void populateConvertArmNeon2dToIntrPatterns(RewritePatternSet &patterns);
-/// 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> createConvertArmNeon2dToIntrPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_ARMNEON2DTOINTR_ARMNEON2DTOINTR_H_
diff --git a/mlir/include/mlir/Conversion/ArmSMEToSCF/ArmSMEToSCF.h b/mlir/include/mlir/Conversion/ArmSMEToSCF/ArmSMEToSCF.h
index 3a28ca11862af..0b9b066690b66 100644
--- a/mlir/include/mlir/Conversion/ArmSMEToSCF/ArmSMEToSCF.h
+++ b/mlir/include/mlir/Conversion/ArmSMEToSCF/ArmSMEToSCF.h
@@ -15,15 +15,12 @@ namespace mlir {
class Pass;
class RewritePatternSet;
-#define GEN_PASS_DECL_CONVERTARMSMETOSCF
+#define GEN_PASS_DECL_CONVERTARMSMETOSCFPASS
#include "mlir/Conversion/Passes.h.inc"
/// Collect a set of patterns to convert from the ArmSME dialect to SCF.
void populateArmSMEToSCFConversionPatterns(RewritePatternSet &patterns);
-/// Create a pass to convert a subset of ArmSME ops to SCF.
-std::unique_ptr<Pass> createConvertArmSMEToSCFPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_ARMSMETOSCF_ARMSMETOSCF_H_
diff --git a/mlir/include/mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h b/mlir/include/mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h
index c7146239f34b1..4beb0a5c3ec59 100644
--- a/mlir/include/mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h
+++ b/mlir/include/mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h
@@ -15,10 +15,9 @@
namespace mlir {
class ModuleOp;
-#define GEN_PASS_DECL_CONVERTBUFFERIZATIONTOMEMREF
+#define GEN_PASS_DECL_CONVERTBUFFERIZATIONTOMEMREFPASS
#include "mlir/Conversion/Passes.h.inc"
-std::unique_ptr<Pass> createBufferizationToMemRefPass();
} // namespace mlir
#endif // MLIR_CONVERSION_BUFFERIZATIONTOMEMREF_BUFFERIZATIONTOMEMREF_H
diff --git a/mlir/include/mlir/Conversion/ComplexToLibm/ComplexToLibm.h b/mlir/include/mlir/Conversion/ComplexToLibm/ComplexToLibm.h
index 49d9f251eec99..475d0f3ce610b 100644
--- a/mlir/include/mlir/Conversion/ComplexToLibm/ComplexToLibm.h
+++ b/mlir/include/mlir/Conversion/ComplexToLibm/ComplexToLibm.h
@@ -8,6 +8,7 @@
#ifndef MLIR_CONVERSION_COMPLEXTOLIBM_COMPLEXTOLIBM_H_
#define MLIR_CONVERSION_COMPLEXTOLIBM_COMPLEXTOLIBM_H_
+#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
namespace mlir {
@@ -22,9 +23,6 @@ class OperationPass;
void populateComplexToLibmConversionPatterns(RewritePatternSet &patterns,
PatternBenefit benefit);
-/// Create a pass to convert Complex operations to libm calls.
-std::unique_ptr<OperationPass<ModuleOp>> createConvertComplexToLibmPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_COMPLEXTOLIBM_COMPLEXTOLIBM_H_
diff --git a/mlir/include/mlir/Conversion/ComplexToStandard/ComplexToStandard.h b/mlir/include/mlir/Conversion/ComplexToStandard/ComplexToStandard.h
index 30b86cac9cd4e..509a68314f987 100644
--- a/mlir/include/mlir/Conversion/ComplexToStandard/ComplexToStandard.h
+++ b/mlir/include/mlir/Conversion/ComplexToStandard/ComplexToStandard.h
@@ -16,7 +16,7 @@ namespace mlir {
class RewritePatternSet;
class Pass;
-#define GEN_PASS_DECL_CONVERTCOMPLEXTOSTANDARD
+#define GEN_PASS_DECL_CONVERTCOMPLEXTOSTANDARDPASS
#include "mlir/Conversion/Passes.h.inc"
/// Populate the given list with patterns that convert from Complex to Standard.
@@ -25,11 +25,6 @@ void populateComplexToStandardConversionPatterns(
mlir::complex::ComplexRangeFlags complexRange =
mlir::complex::ComplexRangeFlags::improved);
-/// Create a pass to convert Complex operations to the Standard dialect.
-std::unique_ptr<Pass> createConvertComplexToStandardPass();
-std::unique_ptr<Pass>
-createConvertComplexToStandardPass(ConvertComplexToStandardOptions options);
-
} // namespace mlir
#endif // MLIR_CONVERSION_COMPLEXTOSTANDARD_COMPLEXTOSTANDARD_H_
diff --git a/mlir/include/mlir/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRVPass.h b/mlir/include/mlir/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRVPass.h
index 929e99d7484d9..eb8c79291e367 100644
--- a/mlir/include/mlir/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRVPass.h
@@ -18,12 +18,9 @@
namespace mlir {
class ModuleOp;
-#define GEN_PASS_DECL_CONVERTCONTROLFLOWTOSPIRV
+#define GEN_PASS_DECL_CONVERTCONTROLFLOWTOSPIRVPASS
#include "mlir/Conversion/Passes.h.inc"
-/// Creates a pass to convert ControlFlow ops to SPIR-V ops.
-std::unique_ptr<OperationPass<>> createConvertControlFlowToSPIRVPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_CONTROLFLOWTOSPIRV_CONTROLFLOWTOSPIRVPASS_H
diff --git a/mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMPass.h b/mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMPass.h
index 73deef49c4175..7de03500f8aaa 100644
--- a/mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMPass.h
+++ b/mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMPass.h
@@ -13,14 +13,10 @@
#include "mlir/Pass/Pass.h"
-#define GEN_PASS_DECL_CONVERTTOLLVMPASS
-#include "mlir/Conversion/Passes.h.inc"
-
namespace mlir {
-/// Create a pass that performs dialect conversion to LLVM for all dialects
-/// implementing `ConvertToLLVMPatternInterface`.
-std::unique_ptr<Pass> createConvertToLLVMPass();
+#define GEN_PASS_DECL_CONVERTTOLLVMPASS
+#include "mlir/Conversion/Passes.h.inc"
/// Register the extension that will load dependent dialects for LLVM
/// conversion. This is useful to implement a pass similar to "convert-to-llvm".
diff --git a/mlir/include/mlir/Conversion/FuncToSPIRV/FuncToSPIRVPass.h b/mlir/include/mlir/Conversion/FuncToSPIRV/FuncToSPIRVPass.h
index aa69b79df8c0e..d903e8e20bc1e 100644
--- a/mlir/include/mlir/Conversion/FuncToSPIRV/FuncToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/FuncToSPIRV/FuncToSPIRVPass.h
@@ -18,12 +18,9 @@
namespace mlir {
class ModuleOp;
-#define GEN_PASS_DECL_CONVERTFUNCTOSPIRV
+#define GEN_PASS_DECL_CONVERTFUNCTOSPIRVPASS
#include "mlir/Conversion/Passes.h.inc"
-/// Creates a pass to convert Func ops to SPIR-V ops.
-std::unique_ptr<OperationPass<>> createConvertFuncToSPIRVPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_FUNCTOSPIRV_FUNCTOSPIRVPASS_H
diff --git a/mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h b/mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
index eefa2c4724833..51b14953a95a7 100644
--- a/mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
+++ b/mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
@@ -10,6 +10,7 @@
#define MLIR_CONVERSION_LINALGTOSTANDARD_LINALGTOSTANDARD_H_
#include "mlir/Dialect/Linalg/IR/Linalg.h"
+#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
namespace mlir {
@@ -17,7 +18,7 @@ class ModuleOp;
template <typename T>
class OperationPass;
-#define GEN_PASS_DECL_CONVERTLINALGTOSTANDARD
+#define GEN_PASS_DECL_CONVERTLINALGTOSTANDARDPASS
#include "mlir/Conversion/Passes.h.inc"
namespace linalg {
@@ -46,10 +47,6 @@ class LinalgOpToLibraryCallRewrite
void populateLinalgToStandardConversionPatterns(RewritePatternSet &patterns);
} // namespace linalg
-
-/// Create a pass to convert Linalg operations to the Standard dialect.
-std::unique_ptr<OperationPass<ModuleOp>> createConvertLinalgToStandardPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_LINALGTOSTANDARD_LINALGTOSTANDARD_H_
diff --git a/mlir/include/mlir/Conversion/MathToLibm/MathToLibm.h b/mlir/include/mlir/Conversion/MathToLibm/MathToLibm.h
index 8ace53a0fd582..75f077d9ab286 100644
--- a/mlir/include/mlir/Conversion/MathToLibm/MathToLibm.h
+++ b/mlir/include/mlir/Conversion/MathToLibm/MathToLibm.h
@@ -9,12 +9,13 @@
#define MLIR_CONVERSION_MATHTOLIBM_MATHTOLIBM_H_
#include "mlir/IR/PatternMatch.h"
+#include "mlir/Pass/Pass.h"
namespace mlir {
template <typename T>
class OperationPass;
-#define GEN_PASS_DECL_CONVERTMATHTOLIBM
+#define GEN_PASS_DECL_CONVERTMATHTOLIBMPASS
#include "mlir/Conversion/Passes.h.inc"
/// Populate the given list with patterns that convert from Math to Libm calls.
@@ -22,9 +23,6 @@ class OperationPass;
void populateMathToLibmConversionPatterns(RewritePatternSet &patterns,
PatternBenefit benefit = 1);
-/// Create a pass to convert Math operations to libm calls.
-std::unique_ptr<OperationPass<ModuleOp>> createConvertMathToLibmPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_MATHTOLIBM_MATHTOLIBM_H_
diff --git a/mlir/include/mlir/Conversion/MathToSPIRV/MathToSPIRVPass.h b/mlir/include/mlir/Conversion/MathToSPIRV/MathToSPIRVPass.h
index ea0f1d3fa3589..bd6431ad84623 100644
--- a/mlir/include/mlir/Conversion/MathToSPIRV/MathToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/MathToSPIRV/MathToSPIRVPass.h
@@ -18,12 +18,9 @@
namespace mlir {
class ModuleOp;
-#define GEN_PASS_DECL_CONVERTMATHTOSPIRV
+#define GEN_PASS_DECL_CONVERTMATHTOSPIRVPASS
#include "mlir/Conversion/Passes.h.inc"
-/// Creates a pass to convert Math ops to SPIR-V ops.
-std::unique_ptr<OperationPass<>> createConvertMathToSPIRVPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_MATHTOSPIRV_MATHTOSPIRVPASS_H
diff --git a/mlir/include/mlir/Conversion/MemRefToSPIRV/MemRefToSPIRVPass.h b/mlir/include/mlir/Conversion/MemRefToSPIRV/MemRefToSPIRVPass.h
index 2cb90bac9bc78..3df54fd8a47bd 100644
--- a/mlir/include/mlir/Conversion/MemRefToSPIRV/MemRefToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/MemRefToSPIRV/MemRefToSPIRVPass.h
@@ -20,16 +20,13 @@ namespace mlir {
class ModuleOp;
#define GEN_PASS_DECL_MAPMEMREFSTORAGECLASS
-#define GEN_PASS_DECL_CONVERTMEMREFTOSPIRV
+#define GEN_PASS_DECL_CONVERTMEMREFTOSPIRVPASS
#include "mlir/Conversion/Passes.h.inc"
/// Creates a pass to map numeric MemRef memory spaces to symbolic SPIR-V
/// storage classes. The mapping is read from the command-line option.
std::unique_ptr<OperationPass<>> createMapMemRefStorageClassPass();
-/// Creates a pass to convert MemRef ops to SPIR-V ops.
-std::unique_ptr<OperationPass<>> createConvertMemRefToSPIRVPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_MEMREFTOSPIRV_MEMREFTOSPIRVPASS_H
diff --git a/mlir/include/mlir/Conversion/MeshToMPI/MeshToMPI.h b/mlir/include/mlir/Conversion/MeshToMPI/MeshToMPI.h
index 44a1cc0adb6a0..bc64e7a3c1c8c 100644
--- a/mlir/include/mlir/Conversion/MeshToMPI/MeshToMPI.h
+++ b/mlir/include/mlir/Conversion/MeshToMPI/MeshToMPI.h
@@ -18,10 +18,6 @@ class Pass;
#define GEN_PASS_DECL_CONVERTMESHTOMPIPASS
#include "mlir/Conversion/Passes.h.inc"
-/// Lowers Mesh communication operations (updateHalo, AllGater, ...)
-/// to MPI primitives.
-std::unique_ptr<::mlir::Pass> createConvertMeshToMPIPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_MESHTOMPI_MESHTOMPI_H
diff --git a/mlir/include/mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h b/mlir/include/mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h
index 44a58667b7a9a..75ded320e2f9e 100644
--- a/mlir/include/mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h
+++ b/mlir/include/mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h
@@ -8,6 +8,7 @@
#ifndef MLIR_CONVERSION_OPENACCTOSCF_CONVERTOPENACCTOSCF_H
#define MLIR_CONVERSION_OPENACCTOSCF_CONVERTOPENACCTOSCF_H
+#include "mlir/Pass/Pass.h"
#include <memory>
namespace mlir {
@@ -16,16 +17,13 @@ template <typename T>
class OperationPass;
class RewritePatternSet;
-#define GEN_PASS_DECL_CONVERTOPENACCTOSCF
+#define GEN_PASS_DECL_CONVERTOPENACCTOSCFPASS
#include "mlir/Conversion/Passes.h.inc"
/// Collect the patterns to convert from the OpenACC dialect to OpenACC with
/// SCF dialect.
void populateOpenACCToSCFConversionPatterns(RewritePatternSet &patterns);
-/// Create a pass to convert the OpenACC dialect into the LLVMIR dialect.
-std::unique_ptr<OperationPass<ModuleOp>> createConvertOpenACCToSCFPass();
-
} // namespace mlir
#endif // MLIR_CONVERSION_OPENACCTOSCF_CONVERTOPENACCTOSCF_H
diff --git a/mlir/include/mlir/Conversion/PDLToPDLInterp/PDLToPDLInterp.h b/mlir/include/mlir/Conversion/PDLToPDLInterp/PDLToPDLInterp.h
index 54033ff1639c7..c6a647245f82b 100644
--- a/mlir/include/mlir/Conversion/PDLToPDLInterp/PDLToPDLInterp.h
+++ b/mlir/include/mlir/Conversion/PDLToPDLInterp/PDLToPDLInterp.h
@@ -13,6 +13,7 @@
#ifndef MLIR_CONVERSION_PDLTOPDLINTERP_PDLTOPDLINTERP_H
#define MLIR_CONVERSION_PDLTOPDLINTERP_PDLTOPDLINTERP_H
+#include "mlir/Pass/Pass.h"
#include "mlir/Support/LLVM.h"
namespace mlir {
@@ -22,16 +23,13 @@ template <typename OpT>
class OperationPass;
class PDLPatternConfigSet;
-#define GEN_PASS_DECL_CONVERTPDLTOPDLINTERP
+#define GEN_PASS_DECL_CONVERTPDLTOPDLINTERPPASS
#include "mlir/Conversion/Passes.h.inc"
-/// Creates and returns a pass to convert PDL ops to PDL interpreter ops.
-std::unique_ptr<OperationPass<ModuleOp>> createPDLToPDLInterpPass();
-
/// Creates and returns a pass to convert PDL ops to PDL interpreter ops.
/// `configMap` holds a map of the configurations for each pattern being
/// compiled.
-std::unique_ptr<OperationPass<ModuleOp>> createPDLToPDLInterpPass(
+std::unique_ptr<OperationPass<ModuleOp>> createConvertPDLToPDLInterpPass(
DenseMap<Operation *, PDLPatternConfigSet *> &configMap);
} // namespace mlir
diff --git a/mlir/include/mlir/Conversion/Passes.td b/mlir/include/mlir/Conversion/Passes.td
index af46975b0213e..0479f32c85341 100644
--- a/mlir/include/mlir/Conversion/Passes.td
+++ b/mlir/include/mlir/Conversion/Passes.td
@@ -30,7 +30,6 @@ def ConvertToLLVMPass : Pass<"convert-to-llvm"> {
extra overhead.
}];
- let constructor = "mlir::createConvertToLLVMPass()";
let options = [
ListOption<"filterDialects", "filter-dialects", "std::string",
"Test conversion patterns of only the specified dialects">,
@@ -40,11 +39,11 @@ def ConvertToLLVMPass : Pass<"convert-to-llvm"> {
}
//===----------------------------------------------------------------------===//
-// AffineToStandard
+// LowerAffine
//===----------------------------------------------------------------------===//
-def ConvertAffineToStandard : Pass<"lower-affine"> {
- let summary = "Lower Affine operations to a combination of Standard and SCF "
+def LowerAffine : Pass<"lower-affine"> {
+ let summary = "Lower Affine operations to a combination of Arith and SCF "
"operations";
let description = [{
@@ -55,7 +54,7 @@ def ConvertAffineToStandard : Pass<"lower-affine"> {
of certain structural restrictions (on their bounds and step). `affine.if`
is similarly converted to the `scf.if` operation. `affine.apply` operations
are converted into sequences of primitive arithmetic operations from the
- standard dialect that have the same effect, using operands of the `index`
+ 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
removed from the module.
@@ -93,24 +92,19 @@ def ConvertAffineToStandard : Pass<"lower-affine"> {
if they do not depend on the loop iterator value or on the result of
`affine.apply`.
}];
- let constructor = "mlir::createLowerAffinePass()";
- let dependentDialects = [
- "memref::MemRefDialect",
- "scf::SCFDialect",
- "vector::VectorDialect"
- ];
+ let dependentDialects = ["arith::ArithDialect", "memref::MemRefDialect",
+ "scf::SCFDialect", "vector::VectorDialect"];
}
//===----------------------------------------------------------------------===//
// AMDGPUToROCDL
//===----------------------------------------------------------------------===//
-def ConvertAMDGPUToROCDL : Pass<"convert-amdgpu-to-rocdl"> {
+def ConvertAMDGPUToROCDLPass : Pass<"convert-amdgpu-to-rocdl"> {
let summary = "Convert AMDGPU dialect to ROCDL dialect";
let description = [{
This pass converts supported AMDGPU ops to ROCDL dialect intrinsics.
}];
- let constructor = "mlir::createConvertAMDGPUToROCDLPass()";
let dependentDialects = [
"LLVM::LLVMDialect",
"ROCDL::ROCDLDialect",
@@ -177,9 +171,8 @@ def ArithToLLVMConversionPass : Pass<"convert-arith-to-llvm"> {
// ArithToSPIRV
//===----------------------------------------------------------------------===//
-def ConvertArithToSPIRV : Pass<"convert-arith-to-spirv"> {
+def ConvertArithToSPIRVPass : Pass<"convert-arith-to-spirv"> {
let summary = "Convert Arith dialect to SPIR-V dialect";
- let constructor = "mlir::arith::createConvertArithToSPIRVPass()";
let dependentDialects = ["spirv::SPIRVDialect"];
let options = [
Option<"emulateLT32BitScalarTypes", "emulate-lt-32-bit-scalar-types",
@@ -202,9 +195,13 @@ def ArithToArmSMEConversionPass : Pass<"convert-arith-to-arm-sme"> {
// ArmNeon2dToIntr
//===----------------------------------------------------------------------===//
-def ConvertArmNeon2dToIntr : Pass<"arm-neon-2d-to-intr"> {
+def ConvertArmNeon2dToIntrPass : Pass<"arm-neon-2d-to-intr"> {
let summary = "Convert Arm NEON structured ops to intrinsics";
- let constructor = "mlir::createConvertArmNeon2dToIntrPass()";
+ 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 dependentDialects = ["arm_neon::ArmNeonDialect", "vector::VectorDialect"];
}
@@ -231,7 +228,7 @...
[truncated]
|
let constructor
for passes in Conversion directory (p…let constructor
for passes in Conversion directory (p…
let constructor
for passes in Conversion directory (p…let constructor
for passes in Conversion directory (part1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the cleanup :)
…art1) `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.
113f780
to
9391140
Compare
Thank you for the cleanup. You mention that |
…tor = ` (NFC) We should avoid specifying it manually and instead rely on TableGen, see also cleanups in #127403
It's more "legacy, don't use in-tree" than "deprecated with intent to remove" at this point. I pushed d25beca to update the doc by the way. |
Thanks a lot Mehdi for the clarification. |
I'm sorry @chsigg. This cleanup idea started as a 1:1 discussion between Mehdi and me. Indeed, we never talked about retiring completely. However, I wonder if we should, as there was a lot of copy-and-paste in tree. I will create a post on Discourse to discuss this further coming days. As for the timeline, it will take a while anyway to clean upstream MLIR even if we decide to fully retire the method. |
@@ -1337,7 +1337,9 @@ void mlir::arith::populateArithToSPIRVPatterns( | |||
|
|||
namespace { | |||
struct ConvertArithToSPIRVPass | |||
: public impl::ConvertArithToSPIRVBase<ConvertArithToSPIRVPass> { | |||
: public impl::ConvertArithToSPIRVPassBase<ConvertArithToSPIRVPass> { | |||
using ConvertArithToSPIRVPassBase::ConvertArithToSPIRVPassBase; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this and the other passes be using Base::Base;
? @chelini
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kuhar yes, you are right. We can use the shorter form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mind taking a look at: #127756? thanks!
During my previous cleanup (llvm#127403), I did not notice that we defined a type alias for the base class. This type alias allows us to use the shorter form Base::Base, and this PR switches to that.
During my previous cleanup (#127403), I did not notice that we defined a type alias for the base class. This type alias allows us to use the shorter form Base::Base, and this PR switches to that.
…ry (part1) (llvm#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.
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.