Skip to content

Commit c1a2292

Browse files
authored
[MLIR][NFC] Retire let constructor for passes in Conversion directory (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.
1 parent e0e67a6 commit c1a2292

File tree

68 files changed

+165
-440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+165
-440
lines changed

flang/include/flang/Optimizer/Support/InitFIR.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ inline void registerMLIRPassesForFortranTools() {
112112
mlir::affine::registerAffineLoopTilingPass();
113113
mlir::affine::registerAffineDataCopyGenerationPass();
114114

115-
mlir::registerConvertAffineToStandardPass();
115+
mlir::registerLowerAffinePass();
116116
}
117117

118118
/// Register the interfaces needed to lower to LLVM IR.

flang/lib/Optimizer/Passes/Pipelines.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void createDefaultFIROptimizerPassPipeline(mlir::PassManager &pm,
205205
pm, fir::createStackReclaim);
206206
// convert control flow to CFG form
207207
fir::addCfgConversionPass(pm, pc);
208-
pm.addPass(mlir::createConvertSCFToCFPass());
208+
pm.addPass(mlir::createSCFToControlFlowPass());
209209

210210
pm.addPass(mlir::createCanonicalizerPass(config));
211211
pm.addPass(fir::createSimplifyRegionLite());

mlir/include/mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class LLVMTypeConverter;
1818
class RewritePatternSet;
1919
class Pass;
2020

21-
#define GEN_PASS_DECL_CONVERTAMDGPUTOROCDL
21+
#define GEN_PASS_DECL_CONVERTAMDGPUTOROCDLPASS
2222
#include "mlir/Conversion/Passes.h.inc"
2323

2424
/// Note: The ROCDL target does not support the LLVM bfloat type at this time
@@ -28,8 +28,6 @@ void populateAMDGPUToROCDLConversionPatterns(const LLVMTypeConverter &converter,
2828
RewritePatternSet &patterns,
2929
amdgpu::Chipset chipset);
3030

31-
std::unique_ptr<Pass> createConvertAMDGPUToROCDLPass();
32-
3331
} // namespace mlir
3432

3533
#endif // MLIR_CONVERSION_AMDGPUTOROCDL_AMDGPUTOROCDL_H_

mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace affine {
2424
class AffineForOp;
2525
} // namespace affine
2626

27-
#define GEN_PASS_DECL_CONVERTAFFINETOSTANDARD
27+
#define GEN_PASS_DECL_LOWERAFFINEPASS
2828
#include "mlir/Conversion/Passes.h.inc"
2929

3030
/// Collect a set of patterns to convert from the Affine dialect to the Standard
@@ -44,11 +44,6 @@ Value lowerAffineLowerBound(affine::AffineForOp op, OpBuilder &builder);
4444
/// standard arithmetic operations.
4545
Value lowerAffineUpperBound(affine::AffineForOp op, OpBuilder &builder);
4646

47-
/// Lowers affine control flow operations (ForStmt, IfStmt and AffineApplyOp)
48-
/// to equivalent lower-level constructs (flow of basic blocks and arithmetic
49-
/// primitives).
50-
std::unique_ptr<Pass> createLowerAffinePass();
51-
5247
} // namespace mlir
5348

5449
#endif // MLIR_CONVERSION_AFFINETOSTANDARD_AFFINETOSTANDARD_H

mlir/include/mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class SPIRVTypeConverter;
1818
class RewritePatternSet;
1919
class Pass;
2020

21-
#define GEN_PASS_DECL_CONVERTARITHTOSPIRV
21+
#define GEN_PASS_DECL_CONVERTARITHTOSPIRVPASS
2222
#include "mlir/Conversion/Passes.h.inc"
2323

2424
namespace arith {

mlir/include/mlir/Conversion/ArmNeon2dToIntr/ArmNeon2dToIntr.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,13 @@ namespace mlir {
1515
class Pass;
1616
class RewritePatternSet;
1717

18-
#define GEN_PASS_DECL_CONVERTARMNEON2DTOINTR
18+
#define GEN_PASS_DECL_CONVERTARMNEON2DTOINTRPASS
1919
#include "mlir/Conversion/Passes.h.inc"
2020

2121
/// Populates patterns for the lowering of Arm NEON 2D ops to intrinsics.
2222
/// See createConvertArmNeon2dToIntrPass.
2323
void populateConvertArmNeon2dToIntrPatterns(RewritePatternSet &patterns);
2424

25-
/// Creates a pass to lower Arm NEON 2D ops to intrinsics, i.e.
26-
/// equivalent ops operating on flattened 1D vectors and mapping more
27-
/// directly to the corresponding Arm NEON instruction.
28-
std::unique_ptr<Pass> createConvertArmNeon2dToIntrPass();
29-
3025
} // namespace mlir
3126

3227
#endif // MLIR_CONVERSION_ARMNEON2DTOINTR_ARMNEON2DTOINTR_H_

mlir/include/mlir/Conversion/ArmSMEToSCF/ArmSMEToSCF.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@ namespace mlir {
1515
class Pass;
1616
class RewritePatternSet;
1717

18-
#define GEN_PASS_DECL_CONVERTARMSMETOSCF
18+
#define GEN_PASS_DECL_CONVERTARMSMETOSCFPASS
1919
#include "mlir/Conversion/Passes.h.inc"
2020

2121
/// Collect a set of patterns to convert from the ArmSME dialect to SCF.
2222
void populateArmSMEToSCFConversionPatterns(RewritePatternSet &patterns);
2323

24-
/// Create a pass to convert a subset of ArmSME ops to SCF.
25-
std::unique_ptr<Pass> createConvertArmSMEToSCFPass();
26-
2724
} // namespace mlir
2825

2926
#endif // MLIR_CONVERSION_ARMSMETOSCF_ARMSMETOSCF_H_

mlir/include/mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
namespace mlir {
1616
class ModuleOp;
1717

18-
#define GEN_PASS_DECL_CONVERTBUFFERIZATIONTOMEMREF
18+
#define GEN_PASS_DECL_CONVERTBUFFERIZATIONTOMEMREFPASS
1919
#include "mlir/Conversion/Passes.h.inc"
2020

21-
std::unique_ptr<Pass> createBufferizationToMemRefPass();
2221
} // namespace mlir
2322

2423
#endif // MLIR_CONVERSION_BUFFERIZATIONTOMEMREF_BUFFERIZATIONTOMEMREF_H

mlir/include/mlir/Conversion/ComplexToLibm/ComplexToLibm.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#ifndef MLIR_CONVERSION_COMPLEXTOLIBM_COMPLEXTOLIBM_H_
99
#define MLIR_CONVERSION_COMPLEXTOLIBM_COMPLEXTOLIBM_H_
1010

11+
#include "mlir/Pass/Pass.h"
1112
#include "mlir/Transforms/DialectConversion.h"
1213

1314
namespace mlir {
@@ -22,9 +23,6 @@ class OperationPass;
2223
void populateComplexToLibmConversionPatterns(RewritePatternSet &patterns,
2324
PatternBenefit benefit);
2425

25-
/// Create a pass to convert Complex operations to libm calls.
26-
std::unique_ptr<OperationPass<ModuleOp>> createConvertComplexToLibmPass();
27-
2826
} // namespace mlir
2927

3028
#endif // MLIR_CONVERSION_COMPLEXTOLIBM_COMPLEXTOLIBM_H_

mlir/include/mlir/Conversion/ComplexToStandard/ComplexToStandard.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace mlir {
1616
class RewritePatternSet;
1717
class Pass;
1818

19-
#define GEN_PASS_DECL_CONVERTCOMPLEXTOSTANDARD
19+
#define GEN_PASS_DECL_CONVERTCOMPLEXTOSTANDARDPASS
2020
#include "mlir/Conversion/Passes.h.inc"
2121

2222
/// Populate the given list with patterns that convert from Complex to Standard.
@@ -25,11 +25,6 @@ void populateComplexToStandardConversionPatterns(
2525
mlir::complex::ComplexRangeFlags complexRange =
2626
mlir::complex::ComplexRangeFlags::improved);
2727

28-
/// Create a pass to convert Complex operations to the Standard dialect.
29-
std::unique_ptr<Pass> createConvertComplexToStandardPass();
30-
std::unique_ptr<Pass>
31-
createConvertComplexToStandardPass(ConvertComplexToStandardOptions options);
32-
3328
} // namespace mlir
3429

3530
#endif // MLIR_CONVERSION_COMPLEXTOSTANDARD_COMPLEXTOSTANDARD_H_

0 commit comments

Comments
 (0)