Skip to content

Commit 61536f2

Browse files
authored
[mlir] Retire additional let constructor (NFC) (llvm#139390)
Three main changes: - The pass createRequestCWrappersPass is renamed as createLLVMRequestCWrappersPass - createOptimizeForTargetPass is now under the LLVM namespace. It’s unclear why the NVVM namespace was used initially, as all passes in LLVMIR/Transforms/Passes.h consistently reside in the LLVM namespace. - DuplicateFunctionEliminationPass is now in the func namespace.
1 parent 8ecb958 commit 61536f2

File tree

17 files changed

+37
-77
lines changed

17 files changed

+37
-77
lines changed

mlir/include/mlir/Dialect/Arith/Transforms/Passes.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ void populateExpandBFloat16Patterns(RewritePatternSet &patterns);
6262
/// Add patterns to expand Arith ops.
6363
void populateArithExpandOpsPatterns(RewritePatternSet &patterns);
6464

65-
/// Create a pass to replace signed ops with unsigned ones where they are proven
66-
/// equivalent.
67-
std::unique_ptr<Pass> createArithUnsignedWhenEquivalentPass();
68-
6965
/// Add patterns for int range based optimizations.
7066
void populateIntRangeOptimizationsPatterns(RewritePatternSet &patterns,
7167
DataFlowSolver &solver);

mlir/include/mlir/Dialect/Arith/Transforms/Passes.td

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def ArithExpandOpsPass : Pass<"arith-expand"> {
2020
];
2121
}
2222

23-
def ArithUnsignedWhenEquivalent : Pass<"arith-unsigned-when-equivalent"> {
23+
def ArithUnsignedWhenEquivalentPass : Pass<"arith-unsigned-when-equivalent"> {
2424
let summary = "Replace signed ops with unsigned ones where they are proven equivalent";
2525
let description = [{
2626
Replace signed ops with their unsigned equivalents when integer range analysis
@@ -33,7 +33,6 @@ def ArithUnsignedWhenEquivalent : Pass<"arith-unsigned-when-equivalent"> {
3333
The affect ops include division, remainder, shifts, min, max, and integer
3434
comparisons.
3535
}];
36-
let constructor = "mlir::arith::createArithUnsignedWhenEquivalentPass()";
3736
}
3837

3938
def ArithIntRangeOpts : Pass<"int-range-optimizations"> {

mlir/include/mlir/Dialect/Func/Transforms/Passes.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,9 @@ class RewritePatternSet;
2222

2323
namespace func {
2424

25-
#define GEN_PASS_DECL
25+
#define GEN_PASS_DECL_DUPLICATEFUNCTIONELIMINATIONPASS
2626
#include "mlir/Dialect/Func/Transforms/Passes.h.inc"
2727

28-
/// Pass to deduplicate functions.
29-
std::unique_ptr<Pass> createDuplicateFunctionEliminationPass();
30-
3128
//===----------------------------------------------------------------------===//
3229
// Registration
3330
//===----------------------------------------------------------------------===//

mlir/include/mlir/Dialect/Func/Transforms/Passes.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def DuplicateFunctionEliminationPass : Pass<"duplicate-function-elimination",
1919
name. The pass chooses one representative per equivalence class, erases
2020
the remainder, and updates function calls accordingly.
2121
}];
22-
let constructor = "mlir::func::createDuplicateFunctionEliminationPass()";
2322
}
2423

2524
#endif // MLIR_DIALECT_FUNC_TRANSFORMS_PASSES_TD

mlir/include/mlir/Dialect/LLVMIR/Transforms/LegalizeForExport.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Pass;
1717

1818
namespace LLVM {
1919

20-
#define GEN_PASS_DECL_LLVMLEGALIZEFOREXPORT
20+
#define GEN_PASS_DECL_LLVMLEGALIZEFOREXPORTPASS
2121
#include "mlir/Dialect/LLVMIR/Transforms/Passes.h.inc"
2222

2323
/// Make argument-taking successors of each block distinct. PHI nodes in LLVM
@@ -27,10 +27,6 @@ namespace LLVM {
2727
/// a new dummy block for LLVM PHI nodes to tell the sources apart.
2828
void ensureDistinctSuccessors(Operation *op);
2929

30-
/// Creates a pass that legalizes the LLVM dialect operations so that they can
31-
/// be translated to LLVM IR.
32-
std::unique_ptr<Pass> createLegalizeForExportPass();
33-
3430
} // namespace LLVM
3531
} // namespace mlir
3632

mlir/include/mlir/Dialect/LLVMIR/Transforms/OptimizeForNVVM.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,10 @@
1313

1414
namespace mlir {
1515
class Pass;
16-
17-
namespace NVVM {
18-
19-
#define GEN_PASS_DECL_NVVMOPTIMIZEFORTARGET
16+
namespace LLVM {
17+
#define GEN_PASS_DECL_NVVMOPTIMIZEFORTARGETPASS
2018
#include "mlir/Dialect/LLVMIR/Transforms/Passes.h.inc"
21-
22-
/// Creates a pass that optimizes LLVM IR for the NVVM target.
23-
std::unique_ptr<Pass> createOptimizeForTargetPass();
24-
25-
} // namespace NVVM
19+
} // namespace LLVM
2620
} // namespace mlir
2721

2822
#endif // MLIR_DIALECT_LLVMIR_TRANSFORMS_OPTIMIZENVVM_H

mlir/include/mlir/Dialect/LLVMIR/Transforms/Passes.td

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ def LLVMAddComdats : Pass<"llvm-add-comdats", "::mlir::ModuleOp"> {
2424
}];
2525
}
2626

27-
def LLVMLegalizeForExport : Pass<"llvm-legalize-for-export"> {
27+
def LLVMLegalizeForExportPass : Pass<"llvm-legalize-for-export"> {
2828
let summary = "Legalize LLVM dialect to be convertible to LLVM IR";
29-
let constructor = "::mlir::LLVM::createLegalizeForExportPass()";
29+
let description = [{
30+
Creates a pass that legalizes the LLVM dialect operations so that they can
31+
be translated to LLVM IR.
32+
}];
3033
let dependentDialects = ["LLVM::LLVMDialect"];
3134
}
3235

33-
def LLVMRequestCWrappers
36+
def LLVMRequestCWrappersPass
3437
: Pass<"llvm-request-c-wrappers", "::mlir::func::FuncOp"> {
3538
let summary = "Request C wrapper emission for all functions";
3639
let description = [{
@@ -40,12 +43,10 @@ def LLVMRequestCWrappers
4043
conversion of builtin functions to LLVM to avoid the attribute being
4144
dropped by other passes.
4245
}];
43-
let constructor = "::mlir::LLVM::createRequestCWrappersPass()";
4446
}
4547

46-
def NVVMOptimizeForTarget : Pass<"llvm-optimize-for-nvvm-target"> {
48+
def NVVMOptimizeForTargetPass : Pass<"llvm-optimize-for-nvvm-target"> {
4749
let summary = "Optimize NVVM IR";
48-
let constructor = "::mlir::NVVM::createOptimizeForTargetPass()";
4950
}
5051

5152
def DIScopeForLLVMFuncOpPass : Pass<"ensure-debug-info-scope-on-llvm-func", "::mlir::ModuleOp"> {

mlir/include/mlir/Dialect/LLVMIR/Transforms/RequestCWrappers.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ class Pass;
1616

1717
namespace LLVM {
1818

19-
#define GEN_PASS_DECL_LLVMREQUESTCWRAPPERS
19+
#define GEN_PASS_DECL_LLVMREQUESTCWRAPPERSPASS
2020
#include "mlir/Dialect/LLVMIR/Transforms/Passes.h.inc"
2121

22-
std::unique_ptr<Pass> createRequestCWrappersPass();
2322
} // namespace LLVM
2423
} // namespace mlir
2524

mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ namespace tensor {
1919
//===----------------------------------------------------------------------===//
2020

2121
/// Creates an instance of the `tensor` subset folding pass.
22-
std::unique_ptr<Pass> createFoldTensorSubsetOpsPass();
22+
#define GEN_PASS_DECL_FOLDTENSORSUBSETOPSPASS
23+
#include "mlir/Dialect/Tensor/Transforms/Passes.h.inc"
2324

2425
//===----------------------------------------------------------------------===//
2526
// Registration

mlir/include/mlir/Dialect/Tensor/Transforms/Passes.td

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
include "mlir/Pass/PassBase.td"
1313

14-
def FoldTensorSubsetOps : Pass<"fold-tensor-subset-ops"> {
14+
def FoldTensorSubsetOpsPass : Pass<"fold-tensor-subset-ops"> {
1515
let summary = "Fold tensor subset ops into producer/consumer ops";
1616
let description = [{
1717
The pass folds tensor subset ops into producer/consumer ops.
@@ -21,7 +21,6 @@ def FoldTensorSubsetOps : Pass<"fold-tensor-subset-ops"> {
2121
- vector.transfer_write into tensor.insert_slice
2222

2323
}];
24-
let constructor = "mlir::tensor::createFoldTensorSubsetOpsPass()";
2524
let dependentDialects = [
2625
"affine::AffineDialect", "tensor::TensorDialect", "vector::VectorDialect"
2726
];

0 commit comments

Comments
 (0)