diff --git a/mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp b/mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp --- a/mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp +++ b/mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp @@ -47,6 +47,11 @@ public: SerializeToCubinPass(); + StringRef getArgument() const override { return "gpu-to-cubin"; } + StringRef getDescription() const override { + return "Lower GPU kernel function to CUBIN binary annotations"; + } + private: void getDependentDialects(DialectRegistry ®istry) const override; @@ -126,7 +131,6 @@ // Register pass to serialize GPU kernel functions to a CUBIN binary annotation. void mlir::registerGpuSerializeToCubinPass() { PassRegistration registerSerializeToCubin( - "gpu-to-cubin", "Lower GPU kernel function to CUBIN binary annotations", [] { // Initialize LLVM NVPTX backend. LLVMInitializeNVPTXTarget(); diff --git a/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp b/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp --- a/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp +++ b/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp @@ -50,6 +50,11 @@ public: SerializeToHsacoPass(); + StringRef getArgument() const override { return "gpu-to-hsaco"; } + StringRef getDescription() const override { + return "Lower GPU kernel function to HSACO binary annotations"; + } + private: void getDependentDialects(DialectRegistry ®istry) const override; @@ -268,7 +273,6 @@ // Register pass to serialize GPU kernel functions to a HSACO binary annotation. void mlir::registerGpuSerializeToHsacoPass() { PassRegistration registerSerializeToHSACO( - "gpu-to-hsaco", "Lower GPU kernel function to HSACO binary annotations", [] { // Initialize LLVM AMDGPU backend. LLVMInitializeAMDGPUAsmParser(); diff --git a/mlir/test/lib/Analysis/TestAliasAnalysis.cpp b/mlir/test/lib/Analysis/TestAliasAnalysis.cpp --- a/mlir/test/lib/Analysis/TestAliasAnalysis.cpp +++ b/mlir/test/lib/Analysis/TestAliasAnalysis.cpp @@ -46,6 +46,10 @@ namespace { struct TestAliasAnalysisPass : public PassWrapper> { + StringRef getArgument() const final { return "test-alias-analysis"; } + StringRef getDescription() const final { + return "Test alias analysis results."; + } void runOnOperation() override { llvm::errs() << "Testing : " << getOperation()->getAttr("sym_name") << "\n"; @@ -84,6 +88,10 @@ namespace { struct TestAliasAnalysisModRefPass : public PassWrapper> { + StringRef getArgument() const final { return "test-alias-analysis-modref"; } + StringRef getDescription() const final { + return "Test alias analysis ModRef results."; + } void runOnOperation() override { llvm::errs() << "Testing : " << getOperation()->getAttr("sym_name") << "\n"; @@ -126,10 +134,8 @@ namespace mlir { namespace test { void registerTestAliasAnalysisPass() { - PassRegistration aliasPass( - "test-alias-analysis", "Test alias analysis results."); - PassRegistration modRefPass( - "test-alias-analysis-modref", "Test alias analysis ModRef results."); + PassRegistration(); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Analysis/TestCallGraph.cpp b/mlir/test/lib/Analysis/TestCallGraph.cpp --- a/mlir/test/lib/Analysis/TestCallGraph.cpp +++ b/mlir/test/lib/Analysis/TestCallGraph.cpp @@ -19,6 +19,10 @@ namespace { struct TestCallGraphPass : public PassWrapper> { + StringRef getArgument() const final { return "test-print-callgraph"; } + StringRef getDescription() const final { + return "Print the contents of a constructed callgraph."; + } void runOnOperation() override { llvm::errs() << "Testing : " << getOperation()->getAttr("test.name") << "\n"; @@ -29,9 +33,6 @@ namespace mlir { namespace test { -void registerTestCallGraphPass() { - PassRegistration pass( - "test-print-callgraph", "Print the contents of a constructed callgraph."); -} +void registerTestCallGraphPass() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Analysis/TestLiveness.cpp b/mlir/test/lib/Analysis/TestLiveness.cpp --- a/mlir/test/lib/Analysis/TestLiveness.cpp +++ b/mlir/test/lib/Analysis/TestLiveness.cpp @@ -20,6 +20,10 @@ namespace { struct TestLivenessPass : public PassWrapper { + StringRef getArgument() const final { return "test-print-liveness"; } + StringRef getDescription() const final { + return "Print the contents of a constructed liveness information."; + } void runOnFunction() override { llvm::errs() << "Testing : " << getFunction().getName() << "\n"; getAnalysis().print(llvm::errs()); @@ -30,10 +34,6 @@ namespace mlir { namespace test { -void registerTestLivenessPass() { - PassRegistration( - "test-print-liveness", - "Print the contents of a constructed liveness information."); -} +void registerTestLivenessPass() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Analysis/TestMemRefBoundCheck.cpp b/mlir/test/lib/Analysis/TestMemRefBoundCheck.cpp --- a/mlir/test/lib/Analysis/TestMemRefBoundCheck.cpp +++ b/mlir/test/lib/Analysis/TestMemRefBoundCheck.cpp @@ -29,6 +29,10 @@ /// Checks for out of bound memref access subscripts.. struct TestMemRefBoundCheck : public PassWrapper { + StringRef getArgument() const final { return "test-memref-bound-check"; } + StringRef getDescription() const final { + return "Check memref access bounds in a Function"; + } void runOnFunction() override; }; @@ -46,9 +50,6 @@ namespace mlir { namespace test { -void registerMemRefBoundCheck() { - PassRegistration( - "test-memref-bound-check", "Check memref access bounds in a Function"); -} +void registerMemRefBoundCheck() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp b/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp --- a/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp +++ b/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp @@ -28,6 +28,10 @@ /// Checks dependences between all pairs of memref accesses in a Function. struct TestMemRefDependenceCheck : public PassWrapper { + StringRef getArgument() const final { return "test-memref-dependence-check"; } + StringRef getDescription() const final { + return "Checks dependences between all pairs of memref accesses."; + } SmallVector loadsAndStores; void runOnFunction() override; }; @@ -112,9 +116,7 @@ namespace mlir { namespace test { void registerTestMemRefDependenceCheck() { - PassRegistration pass( - "test-memref-dependence-check", - "Checks dependences between all pairs of memref accesses."); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Analysis/TestMemRefStrideCalculation.cpp b/mlir/test/lib/Analysis/TestMemRefStrideCalculation.cpp --- a/mlir/test/lib/Analysis/TestMemRefStrideCalculation.cpp +++ b/mlir/test/lib/Analysis/TestMemRefStrideCalculation.cpp @@ -15,6 +15,12 @@ namespace { struct TestMemRefStrideCalculation : public PassWrapper { + StringRef getArgument() const final { + return "test-memref-stride-calculation"; + } + StringRef getDescription() const final { + return "Test operation constant folding"; + } void runOnFunction() override; }; } // end anonymous namespace @@ -51,8 +57,7 @@ namespace mlir { namespace test { void registerTestMemRefStrideCalculation() { - PassRegistration pass( - "test-memref-stride-calculation", "Test operation constant folding"); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Analysis/TestNumberOfExecutions.cpp b/mlir/test/lib/Analysis/TestNumberOfExecutions.cpp --- a/mlir/test/lib/Analysis/TestNumberOfExecutions.cpp +++ b/mlir/test/lib/Analysis/TestNumberOfExecutions.cpp @@ -20,6 +20,14 @@ struct TestNumberOfBlockExecutionsPass : public PassWrapper { + StringRef getArgument() const final { + return "test-print-number-of-block-executions"; + } + StringRef getDescription() const final { + return "Print the contents of a constructed number of executions analysis " + "for " + "all blocks."; + } void runOnFunction() override { llvm::errs() << "Number of executions: " << getFunction().getName() << "\n"; getAnalysis().printBlockExecutions( @@ -29,6 +37,14 @@ struct TestNumberOfOperationExecutionsPass : public PassWrapper { + StringRef getArgument() const final { + return "test-print-number-of-operation-executions"; + } + StringRef getDescription() const final { + return "Print the contents of a constructed number of executions analysis " + "for " + "all operations."; + } void runOnFunction() override { llvm::errs() << "Number of executions: " << getFunction().getName() << "\n"; getAnalysis().printOperationExecutions( @@ -41,17 +57,11 @@ namespace mlir { namespace test { void registerTestNumberOfBlockExecutionsPass() { - PassRegistration( - "test-print-number-of-block-executions", - "Print the contents of a constructed number of executions analysis for " - "all blocks."); + PassRegistration(); } void registerTestNumberOfOperationExecutionsPass() { - PassRegistration( - "test-print-number-of-operation-executions", - "Print the contents of a constructed number of executions analysis for " - "all operations."); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Conversion/StandardToLLVM/TestConvertCallOp.cpp b/mlir/test/lib/Conversion/StandardToLLVM/TestConvertCallOp.cpp --- a/mlir/test/lib/Conversion/StandardToLLVM/TestConvertCallOp.cpp +++ b/mlir/test/lib/Conversion/StandardToLLVM/TestConvertCallOp.cpp @@ -38,6 +38,11 @@ void getDependentDialects(DialectRegistry ®istry) const final { registry.insert(); } + StringRef getArgument() const final { return "test-convert-call-op"; } + StringRef getDescription() const final { + return "Tests conversion of `std.call` to `llvm.call` in " + "presence of custom types"; + } void runOnOperation() override { ModuleOp m = getOperation(); @@ -68,11 +73,6 @@ namespace mlir { namespace test { -void registerConvertCallOpPass() { - PassRegistration( - "test-convert-call-op", - "Tests conversion of `std.call` to `llvm.call` in " - "presence of custom types"); -} +void registerConvertCallOpPass() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp b/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp --- a/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp +++ b/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp @@ -29,6 +29,10 @@ struct TestAffineDataCopy : public PassWrapper { + StringRef getArgument() const final { return PASS_NAME; } + StringRef getDescription() const final { + return "Tests affine data copy utility functions."; + } TestAffineDataCopy() = default; TestAffineDataCopy(const TestAffineDataCopy &pass){}; @@ -128,7 +132,6 @@ namespace mlir { void registerTestAffineDataCopyPass() { - PassRegistration( - PASS_NAME, "Tests affine data copy utility functions."); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/Affine/TestAffineLoopParametricTiling.cpp b/mlir/test/lib/Dialect/Affine/TestAffineLoopParametricTiling.cpp --- a/mlir/test/lib/Dialect/Affine/TestAffineLoopParametricTiling.cpp +++ b/mlir/test/lib/Dialect/Affine/TestAffineLoopParametricTiling.cpp @@ -22,6 +22,10 @@ namespace { struct TestAffineLoopParametricTiling : public PassWrapper { + StringRef getArgument() const final { return "test-affine-parametric-tile"; } + StringRef getDescription() const final { + return "Tile affine loops using SSA values as tile sizes"; + } void runOnFunction() override; }; } // end anonymous namespace @@ -83,9 +87,7 @@ namespace mlir { namespace test { void registerTestAffineLoopParametricTilingPass() { - PassRegistration( - "test-affine-parametric-tile", - "Tile affine loops using SSA values as tile sizes"); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/Affine/TestAffineLoopUnswitching.cpp b/mlir/test/lib/Dialect/Affine/TestAffineLoopUnswitching.cpp --- a/mlir/test/lib/Dialect/Affine/TestAffineLoopUnswitching.cpp +++ b/mlir/test/lib/Dialect/Affine/TestAffineLoopUnswitching.cpp @@ -25,6 +25,10 @@ /// This pass applies the permutation on the first maximal perfect nest. struct TestAffineLoopUnswitching : public PassWrapper { + StringRef getArgument() const final { return PASS_NAME; } + StringRef getDescription() const final { + return "Tests affine loop unswitching / if/else hoisting"; + } TestAffineLoopUnswitching() = default; TestAffineLoopUnswitching(const TestAffineLoopUnswitching &pass) {} @@ -54,7 +58,6 @@ namespace mlir { void registerTestAffineLoopUnswitchingPass() { - PassRegistration( - PASS_NAME, "Tests affine loop unswitching / if/else hoisting"); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/Affine/TestLoopPermutation.cpp b/mlir/test/lib/Dialect/Affine/TestLoopPermutation.cpp --- a/mlir/test/lib/Dialect/Affine/TestLoopPermutation.cpp +++ b/mlir/test/lib/Dialect/Affine/TestLoopPermutation.cpp @@ -27,6 +27,10 @@ /// This pass applies the permutation on the first maximal perfect nest. struct TestLoopPermutation : public PassWrapper { + StringRef getArgument() const final { return PASS_NAME; } + StringRef getDescription() const final { + return "Tests affine loop permutation utility"; + } TestLoopPermutation() = default; TestLoopPermutation(const TestLoopPermutation &pass){}; @@ -62,7 +66,6 @@ namespace mlir { void registerTestLoopPermutationPass() { - PassRegistration( - PASS_NAME, "Tests affine loop permutation utility"); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp b/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp --- a/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp +++ b/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp @@ -75,6 +75,10 @@ void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } + StringRef getArgument() const final { return "affine-super-vectorizer-test"; } + StringRef getDescription() const final { + return "Tests vectorizer standalone functionality."; + } void runOnFunction() override; void testVectorShapeRatio(llvm::raw_ostream &outs); @@ -269,9 +273,5 @@ } namespace mlir { -void registerVectorizerTestPass() { - PassRegistration pass( - "affine-super-vectorizer-test", - "Tests vectorizer standalone functionality."); -} +void registerVectorizerTestPass() { PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/DLTI/TestDataLayoutQuery.cpp b/mlir/test/lib/Dialect/DLTI/TestDataLayoutQuery.cpp --- a/mlir/test/lib/Dialect/DLTI/TestDataLayoutQuery.cpp +++ b/mlir/test/lib/Dialect/DLTI/TestDataLayoutQuery.cpp @@ -21,6 +21,8 @@ /// result types. struct TestDataLayoutQuery : public PassWrapper { + StringRef getArgument() const final { return "test-data-layout-query"; } + StringRef getDescription() const final { return "Test data layout queries"; } void runOnFunction() override { FuncOp func = getFunction(); Builder builder(func.getContext()); @@ -48,9 +50,6 @@ namespace mlir { namespace test { -void registerTestDataLayoutQuery() { - PassRegistration("test-data-layout-query", - "Test data layout queries"); -} +void registerTestDataLayoutQuery() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToCubin.cpp b/mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToCubin.cpp --- a/mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToCubin.cpp +++ b/mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToCubin.cpp @@ -20,6 +20,10 @@ class TestSerializeToCubinPass : public PassWrapper { public: + StringRef getArgument() const final { return "test-gpu-to-cubin"; } + StringRef getDescription() const final { + return "Lower GPU kernel function to CUBIN binary annotations"; + } TestSerializeToCubinPass(); private: @@ -53,17 +57,15 @@ namespace test { // Register test pass to serialize GPU module to a CUBIN binary annotation. void registerTestGpuSerializeToCubinPass() { - PassRegistration registerSerializeToCubin( - "test-gpu-to-cubin", - "Lower GPU kernel function to CUBIN binary annotations", [] { - // Initialize LLVM NVPTX backend. - LLVMInitializeNVPTXTarget(); - LLVMInitializeNVPTXTargetInfo(); - LLVMInitializeNVPTXTargetMC(); - LLVMInitializeNVPTXAsmPrinter(); + PassRegistration([] { + // Initialize LLVM NVPTX backend. + LLVMInitializeNVPTXTarget(); + LLVMInitializeNVPTXTargetInfo(); + LLVMInitializeNVPTXTargetMC(); + LLVMInitializeNVPTXAsmPrinter(); - return std::make_unique(); - }); + return std::make_unique(); + }); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToHsaco.cpp b/mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToHsaco.cpp --- a/mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToHsaco.cpp +++ b/mlir/test/lib/Dialect/GPU/TestConvertGPUKernelToHsaco.cpp @@ -20,6 +20,10 @@ class TestSerializeToHsacoPass : public PassWrapper { public: + StringRef getArgument() const final { return "test-gpu-to-hsaco"; } + StringRef getDescription() const final { + return "Lower GPU kernel function to HSAco binary annotations"; + } TestSerializeToHsacoPass(); private: @@ -52,17 +56,15 @@ namespace test { // Register test pass to serialize GPU module to a HSAco binary annotation. void registerTestGpuSerializeToHsacoPass() { - PassRegistration registerSerializeToHsaco( - "test-gpu-to-hsaco", - "Lower GPU kernel function to HSAco binary annotations", [] { - // Initialize LLVM AMDGPU backend. - LLVMInitializeAMDGPUTarget(); - LLVMInitializeAMDGPUTargetInfo(); - LLVMInitializeAMDGPUTargetMC(); - LLVMInitializeAMDGPUAsmPrinter(); + PassRegistration([] { + // Initialize LLVM AMDGPU backend. + LLVMInitializeAMDGPUTarget(); + LLVMInitializeAMDGPUTargetInfo(); + LLVMInitializeAMDGPUTargetMC(); + LLVMInitializeAMDGPUAsmPrinter(); - return std::make_unique(); - }); + return std::make_unique(); + }); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/GPU/TestGpuMemoryPromotion.cpp b/mlir/test/lib/Dialect/GPU/TestGpuMemoryPromotion.cpp --- a/mlir/test/lib/Dialect/GPU/TestGpuMemoryPromotion.cpp +++ b/mlir/test/lib/Dialect/GPU/TestGpuMemoryPromotion.cpp @@ -35,6 +35,10 @@ registry.insert(); } + StringRef getArgument() const final { return "test-gpu-memory-promotion"; } + StringRef getDescription() const final { + return "Promotes the annotated arguments of gpu.func to workgroup memory."; + } void runOnOperation() override { gpu::GPUFuncOp op = getOperation(); @@ -48,8 +52,6 @@ namespace mlir { void registerTestGpuMemoryPromotionPass() { - PassRegistration( - "test-gpu-memory-promotion", - "Promotes the annotated arguments of gpu.func to workgroup memory."); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/GPU/TestGpuParallelLoopMapping.cpp b/mlir/test/lib/Dialect/GPU/TestGpuParallelLoopMapping.cpp --- a/mlir/test/lib/Dialect/GPU/TestGpuParallelLoopMapping.cpp +++ b/mlir/test/lib/Dialect/GPU/TestGpuParallelLoopMapping.cpp @@ -22,6 +22,12 @@ class TestGpuGreedyParallelLoopMappingPass : public PassWrapper> { + StringRef getArgument() const final { + return "test-gpu-greedy-parallel-loop-mapping"; + } + StringRef getDescription() const final { + return "Greedily maps all parallel loops to gpu hardware ids."; + } void runOnOperation() override { Operation *op = getOperation(); for (Region ®ion : op->getRegions()) @@ -33,9 +39,7 @@ namespace mlir { namespace test { void registerTestGpuParallelLoopMappingPass() { - PassRegistration registration( - "test-gpu-greedy-parallel-loop-mapping", - "Greedily maps all parallel loops to gpu hardware ids."); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/GPU/TestGpuRewrite.cpp b/mlir/test/lib/Dialect/GPU/TestGpuRewrite.cpp --- a/mlir/test/lib/Dialect/GPU/TestGpuRewrite.cpp +++ b/mlir/test/lib/Dialect/GPU/TestGpuRewrite.cpp @@ -24,6 +24,10 @@ void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } + StringRef getArgument() const final { return "test-gpu-rewrite"; } + StringRef getDescription() const final { + return "Applies all rewrite patterns within the GPU dialect."; + } void runOnOperation() override { RewritePatternSet patterns(&getContext()); populateGpuRewritePatterns(patterns); @@ -34,8 +38,6 @@ namespace mlir { void registerTestAllReduceLoweringPass() { - PassRegistration pass( - "test-gpu-rewrite", - "Applies all rewrite patterns within the GPU dialect."); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/Linalg/TestConvVectorization.cpp b/mlir/test/lib/Dialect/Linalg/TestConvVectorization.cpp --- a/mlir/test/lib/Dialect/Linalg/TestConvVectorization.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestConvVectorization.cpp @@ -26,6 +26,10 @@ class TestConvVectorization : public PassWrapper> { public: + StringRef getArgument() const final { return "test-conv-vectorization"; } + StringRef getDescription() const final { + return "Test vectorization of convolutions"; + } TestConvVectorization() = default; TestConvVectorization(const TestConvVectorization &) {} explicit TestConvVectorization(ArrayRef tileSizesParam) { @@ -129,8 +133,7 @@ namespace mlir { namespace test { void registerTestConvVectorization() { - PassRegistration testTransformPatternsPass( - "test-conv-vectorization", "Test vectorization of convolutions"); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgCodegenStrategy.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgCodegenStrategy.cpp --- a/mlir/test/lib/Dialect/Linalg/TestLinalgCodegenStrategy.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgCodegenStrategy.cpp @@ -28,6 +28,10 @@ namespace { struct TestLinalgCodegenStrategy : public PassWrapper { + StringRef getArgument() const final { return "test-linalg-codegen-strategy"; } + StringRef getDescription() const final { + return "Test Linalg Codegen Strategy."; + } TestLinalgCodegenStrategy() = default; TestLinalgCodegenStrategy(const TestLinalgCodegenStrategy &pass) {} @@ -227,8 +231,7 @@ namespace mlir { namespace test { void registerTestLinalgCodegenStrategy() { - PassRegistration testLinalgCodegenStrategyPass( - "test-linalg-codegen-strategy", "Test Linalg Codegen Strategy."); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp --- a/mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp @@ -40,6 +40,8 @@ namespace { struct TestLinalgDistribution : public PassWrapper { + StringRef getArgument() const final { return "test-linalg-distribution"; } + StringRef getDescription() const final { return "Test Linalg distribution."; } TestLinalgDistribution() = default; TestLinalgDistribution(const TestLinalgDistribution &pass) {} void getDependentDialects(DialectRegistry ®istry) const override { @@ -72,8 +74,7 @@ namespace mlir { namespace test { void registerTestLinalgDistribution() { - PassRegistration testTestLinalgDistributionPass( - "test-linalg-distribution", "Test Linalg distribution."); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgElementwiseFusion.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgElementwiseFusion.cpp --- a/mlir/test/lib/Dialect/Linalg/TestLinalgElementwiseFusion.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgElementwiseFusion.cpp @@ -51,6 +51,12 @@ registry.insert(); } + StringRef getArgument() const final { + return "test-linalg-elementwise-fusion-patterns"; + } + StringRef getDescription() const final { + return "Test Linalg element wise operation fusion patterns"; + } void runOnFunction() override { MLIRContext *context = &this->getContext(); @@ -73,6 +79,10 @@ registry .insert(); } + StringRef getArgument() const final { return "test-linalg-push-reshape"; } + StringRef getDescription() const final { + return "Test Linalg reshape push patterns"; + } void runOnFunction() override { MLIRContext *context = &this->getContext(); @@ -86,14 +96,11 @@ namespace test { void registerTestLinalgElementwiseFusion() { - PassRegistration testElementwiseFusionPass( - "test-linalg-elementwise-fusion-patterns", - "Test Linalg element wise operation fusion patterns"); + PassRegistration(); } void registerTestPushExpandingReshape() { - PassRegistration testPushExpandingReshapePass( - "test-linalg-push-reshape", "Test Linalg reshape push patterns"); + PassRegistration(); } } // namespace test diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp --- a/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp @@ -108,16 +108,15 @@ } namespace { -template +template struct TestLinalgFusionTransforms : public PassWrapper, FunctionPass> { - TestLinalgFusionTransforms() = default; - TestLinalgFusionTransforms(const TestLinalgFusionTransforms &pass) {} - void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } + TestLinalgFusionTransforms() = default; + TestLinalgFusionTransforms(const TestLinalgFusionTransforms &pass) {} void runOnFunction() override { MLIRContext *context = &this->getContext(); @@ -130,6 +129,39 @@ (void)applyPatternsAndFoldGreedily(funcOp, std::move(fusionPatterns)); } }; + +struct TestLinalgFusionTransformsParallelLoops + : public TestLinalgFusionTransforms { + StringRef getArgument() const final { + return "test-linalg-fusion-transform-patterns"; + } + StringRef getDescription() const final { + return "Test Linalg fusion transformation patterns by applying them " + "greedily."; + } +}; + +struct TestLinalgFusionTransformsLoops + : public TestLinalgFusionTransforms { + StringRef getArgument() const final { + return "test-linalg-tensor-fusion-transform-patterns"; + } + StringRef getDescription() const final { + return "Test Linalg on tensor fusion transformation " + "patterns by applying them greedily."; + } +}; + +struct TestLinalgFusionTransformsTiledLoops + : public TestLinalgFusionTransforms { + StringRef getArgument() const final { + return "test-linalg-tiled-loop-fusion-transform-patterns"; + } + StringRef getDescription() const final { + return "Test Linalg on tensor fusion transformation " + "patterns by applying them greedily."; + } +}; } // namespace static LogicalResult fuseLinalgOpsGreedily(FuncOp f) { @@ -195,6 +227,10 @@ registry.insert(); } + StringRef getArgument() const final { return "test-linalg-greedy-fusion"; } + StringRef getDescription() const final { + return "Test Linalg fusion by applying a greedy test transformation."; + } void runOnFunction() override { MLIRContext *context = &getContext(); RewritePatternSet patterns = @@ -218,6 +254,10 @@ /// testing. struct TestLinalgTileAndFuseSequencePass : public PassWrapper { + StringRef getArgument() const final { return "test-linalg-tile-and-fuse"; } + StringRef getDescription() const final { + return "Test Linalg tiling and fusion of a sequence of Linalg operations."; + } TestLinalgTileAndFuseSequencePass() = default; TestLinalgTileAndFuseSequencePass( const TestLinalgTileAndFuseSequencePass &pass){}; @@ -261,39 +301,25 @@ op.erase(); } }; + } // namespace namespace mlir { namespace test { void registerTestLinalgFusionTransforms() { - PassRegistration> testFusionTransformsPass( - "test-linalg-fusion-transform-patterns", - "Test Linalg fusion transformation patterns by applying them greedily."); + PassRegistration(); } void registerTestLinalgTensorFusionTransforms() { - PassRegistration> - testTensorFusionTransformsPass( - "test-linalg-tensor-fusion-transform-patterns", - "Test Linalg on tensor fusion transformation " - "patterns by applying them greedily."); + PassRegistration(); } void registerTestLinalgTiledLoopFusionTransforms() { - PassRegistration> - testTiledLoopFusionTransformsPass( - "test-linalg-tiled-loop-fusion-transform-patterns", - "Test Linalg on tensor fusion transformation " - "patterns by applying them greedily."); + PassRegistration(); } void registerTestLinalgGreedyFusion() { - PassRegistration testFusionTransformsPass( - "test-linalg-greedy-fusion", - "Test Linalg fusion by applying a greedy test transformation."); + PassRegistration(); } void registerTestLinalgTileAndFuseSequencePass() { - PassRegistration - testTileAndFuseSequencePass( - "test-linalg-tile-and-fuse", - "Test Linalg tiling and fusion of a sequence of Linalg operations."); + PassRegistration(); } } // namespace test diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgHoisting.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgHoisting.cpp --- a/mlir/test/lib/Dialect/Linalg/TestLinalgHoisting.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgHoisting.cpp @@ -26,6 +26,10 @@ void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } + StringRef getArgument() const final { return "test-linalg-hoisting"; } + StringRef getDescription() const final { + return "Test Linalg hoisting functions."; + } void runOnFunction() override; @@ -46,9 +50,6 @@ namespace mlir { namespace test { -void registerTestLinalgHoisting() { - PassRegistration testTestLinalgHoistingPass( - "test-linalg-hoisting", "Test Linalg hoisting functions."); -} +void registerTestLinalgHoisting() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp --- a/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp @@ -42,6 +42,12 @@ gpu::GPUDialect>(); // clang-format on } + StringRef getArgument() const final { + return "test-linalg-transform-patterns"; + } + StringRef getDescription() const final { + return "Test Linalg transformation patterns by applying them greedily."; + } void runOnFunction() override; @@ -612,9 +618,7 @@ namespace mlir { namespace test { void registerTestLinalgTransforms() { - PassRegistration testTransformPatternsPass( - "test-linalg-transform-patterns", - "Test Linalg transformation patterns by applying them greedily."); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/Math/TestExpandTanh.cpp b/mlir/test/lib/Dialect/Math/TestExpandTanh.cpp --- a/mlir/test/lib/Dialect/Math/TestExpandTanh.cpp +++ b/mlir/test/lib/Dialect/Math/TestExpandTanh.cpp @@ -20,6 +20,8 @@ struct TestExpandTanhPass : public PassWrapper { void runOnFunction() override; + StringRef getArgument() const final { return "test-expand-tanh"; } + StringRef getDescription() const final { return "Test expanding tanh"; } }; } // end anonymous namespace @@ -31,9 +33,6 @@ namespace mlir { namespace test { -void registerTestExpandTanhPass() { - PassRegistration pass("test-expand-tanh", - "Test expanding tanh"); -} +void registerTestExpandTanhPass() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/Math/TestPolynomialApproximation.cpp b/mlir/test/lib/Dialect/Math/TestPolynomialApproximation.cpp --- a/mlir/test/lib/Dialect/Math/TestPolynomialApproximation.cpp +++ b/mlir/test/lib/Dialect/Math/TestPolynomialApproximation.cpp @@ -28,6 +28,12 @@ registry .insert(); } + StringRef getArgument() const final { + return "test-math-polynomial-approximation"; + } + StringRef getDescription() const final { + return "Test math polynomial approximations"; + } }; } // end anonymous namespace @@ -40,9 +46,7 @@ namespace mlir { namespace test { void registerTestMathPolynomialApproximationPass() { - PassRegistration pass( - "test-math-polynomial-approximation", - "Test math polynomial approximations"); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp b/mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp --- a/mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp +++ b/mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp @@ -24,7 +24,9 @@ class TestSCFForUtilsPass : public PassWrapper { public: - explicit TestSCFForUtilsPass() {} + StringRef getArgument() const final { return "test-scf-for-utils"; } + StringRef getDescription() const final { return "test scf.for utils"; } + explicit TestSCFForUtilsPass() = default; void runOnFunction() override { FuncOp func = getFunction(); @@ -54,7 +56,9 @@ class TestSCFIfUtilsPass : public PassWrapper { public: - explicit TestSCFIfUtilsPass() {} + StringRef getArgument() const final { return "test-scf-if-utils"; } + StringRef getDescription() const final { return "test scf.if utils"; } + explicit TestSCFIfUtilsPass() = default; void runOnFunction() override { int count = 0; @@ -73,10 +77,8 @@ namespace mlir { namespace test { void registerTestSCFUtilsPass() { - PassRegistration("test-scf-for-utils", - "test scf.for utils"); - PassRegistration("test-scf-if-utils", - "test scf.if utils"); + PassRegistration(); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp b/mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp --- a/mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp +++ b/mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp @@ -23,6 +23,10 @@ struct PrintOpAvailability : public PassWrapper { void runOnFunction() override; + StringRef getArgument() const final { return "test-spirv-op-availability"; } + StringRef getDescription() const final { + return "Test SPIR-V op availability"; + } }; } // end anonymous namespace @@ -78,8 +82,7 @@ namespace mlir { void registerPrintOpAvailabilityPass() { - PassRegistration printOpAvailabilityPass( - "test-spirv-op-availability", "Test SPIR-V op availability"); + PassRegistration(); } } // namespace mlir @@ -91,6 +94,10 @@ /// A pass for testing SPIR-V op availability. struct ConvertToTargetEnv : public PassWrapper { + StringRef getArgument() const override { return "test-spirv-target-env"; } + StringRef getDescription() const override { + return "Test SPIR-V target environment"; + } void runOnFunction() override; }; @@ -225,7 +232,6 @@ namespace mlir { void registerConvertToTargetEnvPass() { - PassRegistration convertToTargetEnvPass( - "test-spirv-target-env", "Test SPIR-V target environment"); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/SPIRV/TestEntryPointAbi.cpp b/mlir/test/lib/Dialect/SPIRV/TestEntryPointAbi.cpp --- a/mlir/test/lib/Dialect/SPIRV/TestEntryPointAbi.cpp +++ b/mlir/test/lib/Dialect/SPIRV/TestEntryPointAbi.cpp @@ -24,6 +24,12 @@ : public PassWrapper> { public: + StringRef getArgument() const final { return "test-spirv-entry-point-abi"; } + StringRef getDescription() const final { + return "Set the spv.entry_point_abi attribute on GPU kernel function " + "within the " + "module, intended for testing only"; + } TestSpirvEntryPointABIPass() = default; TestSpirvEntryPointABIPass(const TestSpirvEntryPointABIPass &) {} void runOnOperation() override; @@ -56,9 +62,6 @@ namespace mlir { void registerTestSpirvEntryPointABIPass() { - PassRegistration registration( - "test-spirv-entry-point-abi", - "Set the spv.entry_point_abi attribute on GPU kernel function within the " - "module, intended for testing only"); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/SPIRV/TestGLSLCanonicalization.cpp b/mlir/test/lib/Dialect/SPIRV/TestGLSLCanonicalization.cpp --- a/mlir/test/lib/Dialect/SPIRV/TestGLSLCanonicalization.cpp +++ b/mlir/test/lib/Dialect/SPIRV/TestGLSLCanonicalization.cpp @@ -20,6 +20,12 @@ TestGLSLCanonicalizationPass() = default; TestGLSLCanonicalizationPass(const TestGLSLCanonicalizationPass &) {} void runOnOperation() override; + StringRef getArgument() const final { + return "test-spirv-glsl-canonicalization"; + } + StringRef getDescription() const final { + return "Tests SPIR-V canonicalization patterns for GLSL extension."; + } }; } // namespace @@ -31,8 +37,6 @@ namespace mlir { void registerTestSpirvGLSLCanonicalizationPass() { - PassRegistration registration( - "test-spirv-glsl-canonicalization", - "Tests SPIR-V canonicalization patterns for GLSL extension."); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/SPIRV/TestModuleCombiner.cpp b/mlir/test/lib/Dialect/SPIRV/TestModuleCombiner.cpp --- a/mlir/test/lib/Dialect/SPIRV/TestModuleCombiner.cpp +++ b/mlir/test/lib/Dialect/SPIRV/TestModuleCombiner.cpp @@ -20,6 +20,10 @@ : public PassWrapper> { public: + StringRef getArgument() const final { return "test-spirv-module-combiner"; } + StringRef getDescription() const final { + return "Tests SPIR-V module combiner library"; + } TestModuleCombinerPass() = default; TestModuleCombinerPass(const TestModuleCombinerPass &) {} void runOnOperation() override; @@ -41,7 +45,6 @@ namespace mlir { void registerTestSpirvModuleCombinerPass() { - PassRegistration registration( - "test-spirv-module-combiner", "Tests SPIR-V module combiner library"); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/Shape/TestShapeFunctions.cpp b/mlir/test/lib/Dialect/Shape/TestShapeFunctions.cpp --- a/mlir/test/lib/Dialect/Shape/TestShapeFunctions.cpp +++ b/mlir/test/lib/Dialect/Shape/TestShapeFunctions.cpp @@ -20,6 +20,10 @@ struct ReportShapeFnPass : public PassWrapper> { void runOnOperation() override; + StringRef getArgument() const final { return "test-shape-function-report"; } + StringRef getDescription() const final { + return "Test pass to report associated shape functions"; + } }; } // end anonymous namespace @@ -82,8 +86,6 @@ namespace mlir { void registerShapeFunctionTestPasses() { - PassRegistration( - "test-shape-function-report", - "Test pass to report associated shape functions"); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/StandardOps/TestComposeSubView.cpp b/mlir/test/lib/Dialect/StandardOps/TestComposeSubView.cpp --- a/mlir/test/lib/Dialect/StandardOps/TestComposeSubView.cpp +++ b/mlir/test/lib/Dialect/StandardOps/TestComposeSubView.cpp @@ -20,6 +20,10 @@ namespace { struct TestComposeSubViewPass : public PassWrapper { + StringRef getArgument() const final { return "test-compose-subview"; } + StringRef getDescription() const final { + return "Test combining composed subviews"; + } void runOnFunction() override; void getDependentDialects(DialectRegistry ®istry) const override; }; @@ -39,8 +43,7 @@ namespace mlir { namespace test { void registerTestComposeSubView() { - PassRegistration pass( - "test-compose-subview", "Test combining composed subviews"); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/StandardOps/TestDecomposeCallGraphTypes.cpp b/mlir/test/lib/Dialect/StandardOps/TestDecomposeCallGraphTypes.cpp --- a/mlir/test/lib/Dialect/StandardOps/TestDecomposeCallGraphTypes.cpp +++ b/mlir/test/lib/Dialect/StandardOps/TestDecomposeCallGraphTypes.cpp @@ -27,6 +27,12 @@ void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } + StringRef getArgument() const final { + return "test-decompose-call-graph-types"; + } + StringRef getDescription() const final { + return "Decomposes types at call graph boundaries."; + } void runOnOperation() override { ModuleOp module = getOperation(); auto *context = &getContext(); @@ -87,9 +93,7 @@ namespace mlir { namespace test { void registerTestDecomposeCallGraphTypes() { - PassRegistration pass( - "test-decompose-call-graph-types", - "Decomposes types at call graph boundaries."); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/Test/TestPatterns.cpp b/mlir/test/lib/Dialect/Test/TestPatterns.cpp --- a/mlir/test/lib/Dialect/Test/TestPatterns.cpp +++ b/mlir/test/lib/Dialect/Test/TestPatterns.cpp @@ -95,6 +95,8 @@ }; struct TestPatternDriver : public PassWrapper { + StringRef getArgument() const final { return "test-patterns"; } + StringRef getDescription() const final { return "Run test dialect patterns"; } void runOnFunction() override { mlir::RewritePatternSet patterns(&getContext()); populateWithGenerated(patterns); @@ -159,6 +161,8 @@ void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } + StringRef getArgument() const final { return "test-return-type"; } + StringRef getDescription() const final { return "Run return type functions"; } void runOnFunction() override { if (getFunction().getName() == "testCreateFunctions") { @@ -194,6 +198,10 @@ namespace { struct TestDerivedAttributeDriver : public PassWrapper { + StringRef getArgument() const final { return "test-derived-attr"; } + StringRef getDescription() const final { + return "Run test derived attributes"; + } void runOnFunction() override; }; } // end anonymous namespace @@ -585,6 +593,10 @@ struct TestLegalizePatternDriver : public PassWrapper> { + StringRef getArgument() const final { return "test-legalize-patterns"; } + StringRef getDescription() const final { + return "Run test dialect legalization patterns"; + } /// The mode of conversion to use with the driver. enum class ConversionMode { Analysis, Full, Partial }; @@ -733,6 +745,10 @@ struct TestRemappedValue : public mlir::PassWrapper { + StringRef getArgument() const final { return "test-remapped-value"; } + StringRef getDescription() const final { + return "Test public remapped value mechanism in ConversionPatternRewriter"; + } void runOnFunction() override { mlir::RewritePatternSet patterns(&getContext()); patterns.add(&getContext()); @@ -776,6 +792,12 @@ struct TestUnknownRootOpDriver : public mlir::PassWrapper { + StringRef getArgument() const final { + return "test-legalize-unknown-root-patterns"; + } + StringRef getDescription() const final { + return "Test public remapped value mechanism in ConversionPatternRewriter"; + } void runOnFunction() override { mlir::RewritePatternSet patterns(&getContext()); patterns.add(&getContext()); @@ -857,6 +879,12 @@ void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } + StringRef getArgument() const final { + return "test-legalize-type-conversion"; + } + StringRef getDescription() const final { + return "Test various type conversion functionalities in DialectConversion"; + } void runOnOperation() override { // Initialize the type converter. @@ -999,6 +1027,10 @@ struct TestMergeBlocksPatternDriver : public PassWrapper> { + StringRef getArgument() const final { return "test-merge-blocks"; } + StringRef getDescription() const final { + return "Test Merging operation in ConversionPatternRewriter"; + } void runOnOperation() override { MLIRContext *context = &getContext(); mlir::RewritePatternSet patterns(context); @@ -1066,6 +1098,12 @@ struct TestSelectiveReplacementPatternDriver : public PassWrapper> { + StringRef getArgument() const final { + return "test-pattern-selective-replacement"; + } + StringRef getDescription() const final { + return "Test selective replacement in the PatternRewriter"; + } void runOnOperation() override { MLIRContext *context = &getContext(); mlir::RewritePatternSet patterns(context); @@ -1083,39 +1121,24 @@ namespace mlir { namespace test { void registerPatternsTestPass() { - PassRegistration("test-return-type", - "Run return type functions"); + PassRegistration(); - PassRegistration("test-derived-attr", - "Run test derived attributes"); + PassRegistration(); - PassRegistration("test-patterns", - "Run test dialect patterns"); + PassRegistration(); - PassRegistration( - "test-legalize-patterns", "Run test dialect legalization patterns", [] { - return std::make_unique( - legalizerConversionMode); - }); + PassRegistration([] { + return std::make_unique(legalizerConversionMode); + }); - PassRegistration( - "test-remapped-value", - "Test public remapped value mechanism in ConversionPatternRewriter"); + PassRegistration(); - PassRegistration( - "test-legalize-unknown-root-patterns", - "Test public remapped value mechanism in ConversionPatternRewriter"); + PassRegistration(); - PassRegistration( - "test-legalize-type-conversion", - "Test various type conversion functionalities in DialectConversion"); + PassRegistration(); - PassRegistration{ - "test-merge-blocks", - "Test Merging operation in ConversionPatternRewriter"}; - PassRegistration{ - "test-pattern-selective-replacement", - "Test selective replacement in the PatternRewriter"}; + PassRegistration(); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Dialect/Test/TestTraits.cpp b/mlir/test/lib/Dialect/Test/TestTraits.cpp --- a/mlir/test/lib/Dialect/Test/TestTraits.cpp +++ b/mlir/test/lib/Dialect/Test/TestTraits.cpp @@ -32,6 +32,8 @@ namespace { struct TestTraitFolder : public PassWrapper { + StringRef getArgument() const final { return "test-trait-folder"; } + StringRef getDescription() const final { return "Run trait folding"; } void runOnFunction() override { (void)applyPatternsAndFoldGreedily(getFunction(), RewritePatternSet(&getContext())); @@ -40,7 +42,5 @@ } // end anonymous namespace namespace mlir { -void registerTestTraitsPass() { - PassRegistration("test-trait-folder", "Run trait folding"); -} +void registerTestTraitsPass() { PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/Tosa/TosaTestPasses.cpp b/mlir/test/lib/Dialect/Tosa/TosaTestPasses.cpp --- a/mlir/test/lib/Dialect/Tosa/TosaTestPasses.cpp +++ b/mlir/test/lib/Dialect/Tosa/TosaTestPasses.cpp @@ -179,6 +179,10 @@ struct TosaTestQuantUtilAPI : public PassWrapper { + StringRef getArgument() const final { return PASS_NAME; } + StringRef getDescription() const final { + return "TOSA Test: Exercise the APIs in QuantUtils.cpp."; + } void runOnFunction() override; }; @@ -196,7 +200,6 @@ namespace mlir { void registerTosaTestQuantUtilAPIPass() { - PassRegistration( - PASS_NAME, "TOSA Test: Exercise the APIs in QuantUtils.cpp."); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp b/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp --- a/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp +++ b/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp @@ -27,6 +27,12 @@ : public PassWrapper { TestVectorToVectorConversion() = default; TestVectorToVectorConversion(const TestVectorToVectorConversion &pass) {} + StringRef getArgument() const final { + return "test-vector-to-vector-conversion"; + } + StringRef getDescription() const final { + return "Test conversion patterns between ops in the vector dialect"; + } void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); @@ -69,6 +75,13 @@ struct TestVectorSlicesConversion : public PassWrapper { + StringRef getArgument() const final { + return "test-vector-slices-conversion"; + } + StringRef getDescription() const final { + return "Test conversion patterns that lower slices ops in the vector " + "dialect"; + } void runOnFunction() override { RewritePatternSet patterns(&getContext()); populateVectorSlicesLoweringPatterns(patterns); @@ -78,6 +91,13 @@ struct TestVectorContractionConversion : public PassWrapper { + StringRef getArgument() const final { + return "test-vector-contraction-conversion"; + } + StringRef getDescription() const final { + return "Test conversion patterns that lower contract ops in the vector " + "dialect"; + } TestVectorContractionConversion() = default; TestVectorContractionConversion(const TestVectorContractionConversion &pass) { } @@ -146,6 +166,13 @@ struct TestVectorUnrollingPatterns : public PassWrapper { + StringRef getArgument() const final { + return "test-vector-unrolling-patterns"; + } + StringRef getDescription() const final { + return "Test conversion patterns to unroll contract ops in the vector " + "dialect"; + } TestVectorUnrollingPatterns() = default; TestVectorUnrollingPatterns(const TestVectorUnrollingPatterns &pass) {} void runOnFunction() override { @@ -199,6 +226,13 @@ struct TestVectorDistributePatterns : public PassWrapper { + StringRef getArgument() const final { + return "test-vector-distribute-patterns"; + } + StringRef getDescription() const final { + return "Test conversion patterns to distribute vector ops in the vector " + "dialect"; + } TestVectorDistributePatterns() = default; TestVectorDistributePatterns(const TestVectorDistributePatterns &pass) {} void getDependentDialects(DialectRegistry ®istry) const override { @@ -249,6 +283,10 @@ struct TestVectorToLoopPatterns : public PassWrapper { + StringRef getArgument() const final { return "test-vector-to-forloop"; } + StringRef getDescription() const final { + return "Test conversion patterns to break up a vector op into a for loop"; + } TestVectorToLoopPatterns() = default; TestVectorToLoopPatterns(const TestVectorToLoopPatterns &pass) {} void getDependentDialects(DialectRegistry ®istry) const override { @@ -312,6 +350,13 @@ void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } + StringRef getArgument() const final { + return "test-vector-transfer-unrolling-patterns"; + } + StringRef getDescription() const final { + return "Test conversion patterns to unroll transfer ops in the vector " + "dialect"; + } void runOnFunction() override { MLIRContext *ctx = &getContext(); RewritePatternSet patterns(ctx); @@ -332,6 +377,13 @@ struct TestVectorTransferFullPartialSplitPatterns : public PassWrapper { + StringRef getArgument() const final { + return "test-vector-transfer-full-partial-split"; + } + StringRef getDescription() const final { + return "Test conversion patterns to split " + "transfer ops via scf.if + linalg ops"; + } TestVectorTransferFullPartialSplitPatterns() = default; TestVectorTransferFullPartialSplitPatterns( const TestVectorTransferFullPartialSplitPatterns &pass) {} @@ -361,6 +413,10 @@ struct TestVectorTransferOpt : public PassWrapper { + StringRef getArgument() const final { return "test-vector-transferop-opt"; } + StringRef getDescription() const final { + return "Test optimization transformations for transfer ops"; + } void runOnFunction() override { transferOpflowOpt(getFunction()); } }; @@ -369,6 +425,12 @@ void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } + StringRef getArgument() const final { + return "test-vector-transfer-lowering-patterns"; + } + StringRef getDescription() const final { + return "Test conversion patterns to lower transfer ops to other vector ops"; + } void runOnFunction() override { RewritePatternSet patterns(&getContext()); populateVectorTransferLoweringPatterns(patterns); @@ -382,6 +444,13 @@ void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } + StringRef getArgument() const final { + return "test-vector-multi-reduction-lowering-patterns"; + } + StringRef getDescription() const final { + return "Test conversion patterns to lower vector.multi_reduction to other " + "vector ops"; + } void runOnFunction() override { RewritePatternSet patterns(&getContext()); populateVectorMultiReductionLoweringPatterns(patterns); @@ -394,53 +463,27 @@ namespace mlir { namespace test { void registerTestVectorConversions() { - PassRegistration vectorToVectorPass( - "test-vector-to-vector-conversion", - "Test conversion patterns between ops in the vector dialect"); - - PassRegistration slicesPass( - "test-vector-slices-conversion", - "Test conversion patterns that lower slices ops in the vector dialect"); - - PassRegistration contractionPass( - "test-vector-contraction-conversion", - "Test conversion patterns that lower contract ops in the vector dialect"); - - PassRegistration contractionUnrollingPass( - "test-vector-unrolling-patterns", - "Test conversion patterns to unroll contract ops in the vector dialect"); - - PassRegistration transferOpUnrollingPass( - "test-vector-transfer-unrolling-patterns", - "Test conversion patterns to unroll transfer ops in the vector dialect"); - - PassRegistration - vectorTransformFullPartialPass("test-vector-transfer-full-partial-split", - "Test conversion patterns to split " - "transfer ops via scf.if + linalg ops"); - - PassRegistration distributePass( - "test-vector-distribute-patterns", - "Test conversion patterns to distribute vector ops in the vector " - "dialect"); - - PassRegistration vectorToForLoop( - "test-vector-to-forloop", - "Test conversion patterns to break up a vector op into a for loop"); - - PassRegistration transferOpOpt( - "test-vector-transferop-opt", - "Test optimization transformations for transfer ops"); - - PassRegistration transferOpLoweringPass( - "test-vector-transfer-lowering-patterns", - "Test conversion patterns to lower transfer ops to other vector ops"); - - PassRegistration - multiDimReductionOpLoweringPass( - "test-vector-multi-reduction-lowering-patterns", - "Test conversion patterns to lower vector.multi_reduction to other " - "vector ops"); + PassRegistration(); + + PassRegistration(); + + PassRegistration(); + + PassRegistration(); + + PassRegistration(); + + PassRegistration(); + + PassRegistration(); + + PassRegistration(); + + PassRegistration(); + + PassRegistration(); + + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/IR/TestDominance.cpp b/mlir/test/lib/IR/TestDominance.cpp --- a/mlir/test/lib/IR/TestDominance.cpp +++ b/mlir/test/lib/IR/TestDominance.cpp @@ -91,6 +91,10 @@ }; struct TestDominancePass : public PassWrapper { + StringRef getArgument() const final { return "test-print-dominance"; } + StringRef getDescription() const final { + return "Print the dominance information for multiple regions."; + } void runOnFunction() override { llvm::errs() << "Testing : " << getFunction().getName() << "\n"; @@ -120,10 +124,6 @@ namespace mlir { namespace test { -void registerTestDominancePass() { - PassRegistration( - "test-print-dominance", - "Print the dominance information for multiple regions."); -} +void registerTestDominancePass() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/IR/TestFunc.cpp b/mlir/test/lib/IR/TestFunc.cpp --- a/mlir/test/lib/IR/TestFunc.cpp +++ b/mlir/test/lib/IR/TestFunc.cpp @@ -15,6 +15,8 @@ /// This is a test pass for verifying FuncOp's eraseArgument method. struct TestFuncEraseArg : public PassWrapper> { + StringRef getArgument() const final { return "test-func-erase-arg"; } + StringRef getDescription() const final { return "Test erasing func args."; } void runOnOperation() override { auto module = getOperation(); @@ -39,21 +41,28 @@ /// This is a test pass for verifying FuncOp's eraseResult method. struct TestFuncEraseResult : public PassWrapper> { + StringRef getArgument() const final { return "test-func-erase-result"; } + StringRef getDescription() const final { + return "Test erasing func results."; + } void runOnOperation() override { auto module = getOperation(); for (FuncOp func : module.getOps()) { SmallVector indicesToErase; for (auto resultIndex : llvm::seq(0, func.getNumResults())) { - if (func.getResultAttr(resultIndex, "test.erase_this_result")) { - // Push back twice to test that duplicate indices are handled - // correctly. + if (func.getResultAttr(resultIndex, "test.erase_this_" + "result")) { + // Push back twice to test + // that duplicate indices + // are handled correctly. indicesToErase.push_back(resultIndex); indicesToErase.push_back(resultIndex); } } - // Reverse the order to test that unsorted index lists are handled - // correctly. + // Reverse the order to test + // that unsorted index lists are + // handled correctly. std::reverse(indicesToErase.begin(), indicesToErase.end()); func.eraseResults(indicesToErase); } @@ -63,6 +72,8 @@ /// This is a test pass for verifying FuncOp's setType method. struct TestFuncSetType : public PassWrapper> { + StringRef getArgument() const final { return "test-func-set-type"; } + StringRef getDescription() const final { return "Test FuncOp::setType."; } void runOnOperation() override { auto module = getOperation(); SymbolTable symbolTable(module); @@ -79,13 +90,10 @@ namespace mlir { void registerTestFunc() { - PassRegistration("test-func-erase-arg", - "Test erasing func args."); + PassRegistration(); - PassRegistration("test-func-erase-result", - "Test erasing func results."); + PassRegistration(); - PassRegistration("test-func-set-type", - "Test FuncOp::setType."); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/IR/TestInterfaces.cpp b/mlir/test/lib/IR/TestInterfaces.cpp --- a/mlir/test/lib/IR/TestInterfaces.cpp +++ b/mlir/test/lib/IR/TestInterfaces.cpp @@ -17,6 +17,10 @@ /// application. struct TestTypeInterfaces : public PassWrapper> { + StringRef getArgument() const final { return "test-type-interfaces"; } + StringRef getDescription() const final { + return "Test type interface support."; + } void runOnOperation() override { getOperation().walk([](Operation *op) { for (Type type : op->getResultTypes()) { @@ -40,9 +44,6 @@ namespace mlir { namespace test { -void registerTestInterfaces() { - PassRegistration pass("test-type-interfaces", - "Test type interface support."); -} +void registerTestInterfaces() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/IR/TestMatchers.cpp b/mlir/test/lib/IR/TestMatchers.cpp --- a/mlir/test/lib/IR/TestMatchers.cpp +++ b/mlir/test/lib/IR/TestMatchers.cpp @@ -17,6 +17,10 @@ /// This is a test pass for verifying matchers. struct TestMatchers : public PassWrapper { void runOnFunction() override; + StringRef getArgument() const final { return "test-matchers"; } + StringRef getDescription() const final { + return "Test C++ pattern matchers."; + } }; } // end anonymous namespace @@ -148,7 +152,5 @@ } namespace mlir { -void registerTestMatchers() { - PassRegistration("test-matchers", "Test C++ pattern matchers."); -} +void registerTestMatchers() { PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/IR/TestOpaqueLoc.cpp b/mlir/test/lib/IR/TestOpaqueLoc.cpp --- a/mlir/test/lib/IR/TestOpaqueLoc.cpp +++ b/mlir/test/lib/IR/TestOpaqueLoc.cpp @@ -18,6 +18,10 @@ /// locations. struct TestOpaqueLoc : public PassWrapper> { + StringRef getArgument() const final { return "test-opaque-loc"; } + StringRef getDescription() const final { + return "Changes all leaf locations to opaque locations"; + } /// A simple structure which is used for testing as an underlying location in /// OpaqueLoc. @@ -82,9 +86,6 @@ namespace mlir { namespace test { -void registerTestOpaqueLoc() { - PassRegistration pass( - "test-opaque-loc", "Changes all leaf locations to opaque locations"); -} +void registerTestOpaqueLoc() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/IR/TestPrintDefUse.cpp b/mlir/test/lib/IR/TestPrintDefUse.cpp --- a/mlir/test/lib/IR/TestPrintDefUse.cpp +++ b/mlir/test/lib/IR/TestPrintDefUse.cpp @@ -16,6 +16,8 @@ /// This pass illustrates the IR def-use chains through printing. struct TestPrintDefUsePass : public PassWrapper> { + StringRef getArgument() const final { return "test-print-defuse"; } + StringRef getDescription() const final { return "Test various printing."; } void runOnOperation() override { // Recursively traverse the IR nested under the current operation and print // every single operation and their operands and users. @@ -64,8 +66,5 @@ } // end anonymous namespace namespace mlir { -void registerTestPrintDefUsePass() { - PassRegistration("test-print-defuse", - "Test various printing."); -} +void registerTestPrintDefUsePass() { PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/IR/TestPrintNesting.cpp b/mlir/test/lib/IR/TestPrintNesting.cpp --- a/mlir/test/lib/IR/TestPrintNesting.cpp +++ b/mlir/test/lib/IR/TestPrintNesting.cpp @@ -16,6 +16,8 @@ /// This pass illustrates the IR nesting through printing. struct TestPrintNestingPass : public PassWrapper> { + StringRef getArgument() const final { return "test-print-nesting"; } + StringRef getDescription() const final { return "Test various printing."; } // Entry point for the pass. void runOnOperation() override { Operation *op = getOperation(); @@ -90,7 +92,6 @@ namespace mlir { void registerTestPrintNestingPass() { - PassRegistration("test-print-nesting", - "Test various printing."); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/IR/TestSideEffects.cpp b/mlir/test/lib/IR/TestSideEffects.cpp --- a/mlir/test/lib/IR/TestSideEffects.cpp +++ b/mlir/test/lib/IR/TestSideEffects.cpp @@ -14,6 +14,10 @@ namespace { struct SideEffectsPass : public PassWrapper> { + StringRef getArgument() const final { return "test-side-effects"; } + StringRef getDescription() const final { + return "Test side effects interfaces"; + } void runOnOperation() override { auto module = getOperation(); @@ -68,8 +72,5 @@ } // end anonymous namespace namespace mlir { -void registerSideEffectTestPasses() { - PassRegistration("test-side-effects", - "Test side effects interfaces"); -} +void registerSideEffectTestPasses() { PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/IR/TestSlicing.cpp b/mlir/test/lib/IR/TestSlicing.cpp --- a/mlir/test/lib/IR/TestSlicing.cpp +++ b/mlir/test/lib/IR/TestSlicing.cpp @@ -47,6 +47,10 @@ /// Pass to test slice generated from slice analysis. struct SliceAnalysisTestPass : public PassWrapper> { + StringRef getArgument() const final { return "slice-analysis-test"; } + StringRef getDescription() const final { + return "Test Slice analysis functionality."; + } void runOnOperation() override; SliceAnalysisTestPass() = default; SliceAnalysisTestPass(const SliceAnalysisTestPass &) {} @@ -74,7 +78,6 @@ namespace mlir { void registerSliceAnalysisTestPass() { - PassRegistration pass( - "slice-analysis-test", "Test Slice analysis functionality."); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/IR/TestSymbolUses.cpp b/mlir/test/lib/IR/TestSymbolUses.cpp --- a/mlir/test/lib/IR/TestSymbolUses.cpp +++ b/mlir/test/lib/IR/TestSymbolUses.cpp @@ -17,6 +17,10 @@ /// provided by the symbol table along with erasing from the symbol table. struct SymbolUsesPass : public PassWrapper> { + StringRef getArgument() const final { return "test-symbol-uses"; } + StringRef getDescription() const final { + return "Test detection of symbol uses"; + } WalkResult operateOnSymbol(Operation *symbol, ModuleOp module, SmallVectorImpl &deadFunctions) { // Test computing uses on a non symboltable op. @@ -89,6 +93,10 @@ /// functionality provided by the symbol table. struct SymbolReplacementPass : public PassWrapper> { + StringRef getArgument() const final { return "test-symbol-rauw"; } + StringRef getDescription() const final { + return "Test replacement of symbol uses"; + } void runOnOperation() override { ModuleOp module = getOperation(); @@ -111,10 +119,8 @@ namespace mlir { void registerSymbolTestPasses() { - PassRegistration("test-symbol-uses", - "Test detection of symbol uses"); + PassRegistration(); - PassRegistration("test-symbol-rauw", - "Test replacement of symbol uses"); + PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/IR/TestTypes.cpp b/mlir/test/lib/IR/TestTypes.cpp --- a/mlir/test/lib/IR/TestTypes.cpp +++ b/mlir/test/lib/IR/TestTypes.cpp @@ -18,6 +18,10 @@ : public PassWrapper { LogicalResult createIRWithTypes(); + StringRef getArgument() const final { return "test-recursive-types"; } + StringRef getDescription() const final { + return "Test support for recursive types"; + } void runOnFunction() override { FuncOp func = getFunction(); @@ -73,8 +77,7 @@ namespace test { void registerTestRecursiveTypesPass() { - PassRegistration reg( - "test-recursive-types", "Test support for recursive types"); + PassRegistration(); } } // namespace test diff --git a/mlir/test/lib/IR/TestVisitors.cpp b/mlir/test/lib/IR/TestVisitors.cpp --- a/mlir/test/lib/IR/TestVisitors.cpp +++ b/mlir/test/lib/IR/TestVisitors.cpp @@ -152,6 +152,8 @@ /// This pass exercises the different configurations of the IR visitors. struct TestIRVisitorsPass : public PassWrapper> { + StringRef getArgument() const final { return "test-ir-visitors"; } + StringRef getDescription() const final { return "Test various visitors."; } void runOnOperation() override { Operation *op = getOperation(); testPureCallbacks(op); @@ -163,9 +165,6 @@ namespace mlir { namespace test { -void registerTestIRVisitorsPass() { - PassRegistration("test-ir-visitors", - "Test various visitors."); -} +void registerTestIRVisitorsPass() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Pass/TestDynamicPipeline.cpp b/mlir/test/lib/Pass/TestDynamicPipeline.cpp --- a/mlir/test/lib/Pass/TestDynamicPipeline.cpp +++ b/mlir/test/lib/Pass/TestDynamicPipeline.cpp @@ -20,6 +20,11 @@ class TestDynamicPipelinePass : public PassWrapper> { public: + StringRef getArgument() const final { return "test-dynamic-pipeline"; } + StringRef getDescription() const final { + return "Tests the dynamic pipeline feature by applying " + "a pipeline on a selected set of functions"; + } void getDependentDialects(DialectRegistry ®istry) const override { OpPassManager pm(ModuleOp::getOperationName(), OpPassManager::Nesting::Implicit); @@ -106,9 +111,7 @@ namespace mlir { namespace test { void registerTestDynamicPipelinePass() { - PassRegistration( - "test-dynamic-pipeline", "Tests the dynamic pipeline feature by applying " - "a pipeline on a selected set of functions"); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Pass/TestPassManager.cpp b/mlir/test/lib/Pass/TestPassManager.cpp --- a/mlir/test/lib/Pass/TestPassManager.cpp +++ b/mlir/test/lib/Pass/TestPassManager.cpp @@ -17,10 +17,16 @@ : public PassWrapper> { void runOnOperation() final {} StringRef getArgument() const final { return "test-module-pass"; } + StringRef getDescription() const final { + return "Test a module pass in the pass manager"; + } }; struct TestFunctionPass : public PassWrapper { void runOnFunction() final {} StringRef getArgument() const final { return "test-function-pass"; } + StringRef getDescription() const final { + return "Test a function pass in the pass manager"; + } }; class TestOptionsPass : public PassWrapper { public: @@ -44,6 +50,9 @@ void runOnFunction() final {} StringRef getArgument() const final { return "test-options-pass"; } + StringRef getDescription() const final { + return "Test options parsing capabilities"; + } ListOption listOption{*this, "list", llvm::cl::MiscFlags::CommaSeparated, llvm::cl::desc("Example list option")}; @@ -60,12 +69,19 @@ : public PassWrapper> { void runOnOperation() final { abort(); } StringRef getArgument() const final { return "test-pass-crash"; } + StringRef getDescription() const final { + return "Test a pass in the pass manager that always crashes"; + } }; /// A test pass that always fails to enable testing the failure recovery /// mechanisms of the pass manager. class TestFailurePass : public PassWrapper> { void runOnOperation() final { signalPassFailure(); } + StringRef getArgument() const final { return "test-pass-failure"; } + StringRef getDescription() const final { + return "Test a pass in the pass manager that always fails"; + } }; /// A test pass that contains a statistic. @@ -73,6 +89,8 @@ : public PassWrapper> { TestStatisticPass() = default; TestStatisticPass(const TestStatisticPass &) {} + StringRef getArgument() const final { return "test-stats-pass"; } + StringRef getDescription() const final { return "Test pass statistics"; } Statistic opCount{this, "num-ops", "Number of operations counted"}; @@ -102,22 +120,16 @@ namespace mlir { void registerPassManagerTestPass() { - PassRegistration("test-options-pass", - "Test options parsing capabilities"); + PassRegistration(); - PassRegistration("test-module-pass", - "Test a module pass in the pass manager"); + PassRegistration(); - PassRegistration( - "test-function-pass", "Test a function pass in the pass manager"); + PassRegistration(); - PassRegistration( - "test-pass-crash", "Test a pass in the pass manager that always crashes"); - PassRegistration( - "test-pass-failure", "Test a pass in the pass manager that always fails"); + PassRegistration(); + PassRegistration(); - PassRegistration unusedStatP("test-stats-pass", - "Test pass statistics"); + PassRegistration(); PassPipelineRegistration<>("test-pm-nested-pipeline", "Test a nested pipeline in the pass manager", diff --git a/mlir/test/lib/Reducer/MLIRTestReducer.cpp b/mlir/test/lib/Reducer/MLIRTestReducer.cpp --- a/mlir/test/lib/Reducer/MLIRTestReducer.cpp +++ b/mlir/test/lib/Reducer/MLIRTestReducer.cpp @@ -26,6 +26,10 @@ /// "crashOp" in the input MLIR file and crashes the mlir-opt tool if the /// operation is found. struct TestReducer : public PassWrapper { + StringRef getArgument() const final { return PASS_NAME; } + StringRef getDescription() const final { + return "Tests MLIR Reduce tool by generating failures"; + } TestReducer() = default; TestReducer(const TestReducer &pass){}; void runOnFunction() override; @@ -47,8 +51,5 @@ } namespace mlir { -void registerTestReducer() { - PassRegistration( - PASS_NAME, "Tests MLIR Reduce tool by generating failures"); -} +void registerTestReducer() { PassRegistration(); } } // namespace mlir diff --git a/mlir/test/lib/Rewrite/TestPDLByteCode.cpp b/mlir/test/lib/Rewrite/TestPDLByteCode.cpp --- a/mlir/test/lib/Rewrite/TestPDLByteCode.cpp +++ b/mlir/test/lib/Rewrite/TestPDLByteCode.cpp @@ -71,6 +71,10 @@ namespace { struct TestPDLByteCodePass : public PassWrapper> { + StringRef getArgument() const final { return "test-pdl-bytecode-pass"; } + StringRef getDescription() const final { + return "Test PDL ByteCode functionality"; + } void runOnOperation() final { ModuleOp module = getOperation(); @@ -107,9 +111,6 @@ namespace mlir { namespace test { -void registerTestPDLByteCodePass() { - PassRegistration("test-pdl-bytecode-pass", - "Test PDL ByteCode functionality"); -} +void registerTestPDLByteCodePass() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Transforms/TestConstantFold.cpp b/mlir/test/lib/Transforms/TestConstantFold.cpp --- a/mlir/test/lib/Transforms/TestConstantFold.cpp +++ b/mlir/test/lib/Transforms/TestConstantFold.cpp @@ -16,6 +16,10 @@ namespace { /// Simple constant folding pass. struct TestConstantFold : public PassWrapper { + StringRef getArgument() const final { return "test-constant-fold"; } + StringRef getDescription() const final { + return "Test operation constant folding"; + } // All constants in the function post folding. SmallVector existingConstants; @@ -62,9 +66,6 @@ namespace mlir { namespace test { -void registerTestConstantFold() { - PassRegistration("test-constant-fold", - "Test operation constant folding"); -} +void registerTestConstantFold() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Transforms/TestInlining.cpp b/mlir/test/lib/Transforms/TestInlining.cpp --- a/mlir/test/lib/Transforms/TestInlining.cpp +++ b/mlir/test/lib/Transforms/TestInlining.cpp @@ -26,6 +26,11 @@ namespace { struct Inliner : public PassWrapper { + StringRef getArgument() const final { return "test-inline"; } + StringRef getDescription() const final { + return "Test inlining region calls"; + } + void runOnFunction() override { auto function = getFunction(); @@ -63,8 +68,6 @@ namespace mlir { namespace test { -void registerInliner() { - PassRegistration("test-inline", "Test inlining region calls"); -} +void registerInliner() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Transforms/TestLoopFusion.cpp b/mlir/test/lib/Transforms/TestLoopFusion.cpp --- a/mlir/test/lib/Transforms/TestLoopFusion.cpp +++ b/mlir/test/lib/Transforms/TestLoopFusion.cpp @@ -42,6 +42,10 @@ namespace { struct TestLoopFusion : public PassWrapper { + StringRef getArgument() const final { return "test-loop-fusion"; } + StringRef getDescription() const final { + return "Tests loop fusion utility functions."; + } void runOnFunction() override; }; @@ -198,9 +202,6 @@ namespace mlir { namespace test { -void registerTestLoopFusion() { - PassRegistration("test-loop-fusion", - "Tests loop fusion utility functions."); -} +void registerTestLoopFusion() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Transforms/TestLoopMapping.cpp b/mlir/test/lib/Transforms/TestLoopMapping.cpp --- a/mlir/test/lib/Transforms/TestLoopMapping.cpp +++ b/mlir/test/lib/Transforms/TestLoopMapping.cpp @@ -26,6 +26,12 @@ class TestLoopMappingPass : public PassWrapper { public: + StringRef getArgument() const final { + return "test-mapping-to-processing-elements"; + } + StringRef getDescription() const final { + return "test mapping a single loop on a virtual processor grid"; + } explicit TestLoopMappingPass() {} void getDependentDialects(DialectRegistry ®istry) const override { @@ -58,10 +64,6 @@ namespace mlir { namespace test { -void registerTestLoopMappingPass() { - PassRegistration( - "test-mapping-to-processing-elements", - "test mapping a single loop on a virtual processor grid"); -} +void registerTestLoopMappingPass() { PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Transforms/TestLoopParametricTiling.cpp b/mlir/test/lib/Transforms/TestLoopParametricTiling.cpp --- a/mlir/test/lib/Transforms/TestLoopParametricTiling.cpp +++ b/mlir/test/lib/Transforms/TestLoopParametricTiling.cpp @@ -25,6 +25,14 @@ class SimpleParametricLoopTilingPass : public PassWrapper { public: + StringRef getArgument() const final { + return "test-extract-fixed-outer-loops"; + } + StringRef getDescription() const final { + return "test application of parametric tiling to the outer loops so that " + "the " + "ranges of outer loops become static"; + } SimpleParametricLoopTilingPass() = default; SimpleParametricLoopTilingPass(const SimpleParametricLoopTilingPass &) {} explicit SimpleParametricLoopTilingPass(ArrayRef outerLoopSizes) { @@ -51,10 +59,7 @@ namespace mlir { namespace test { void registerSimpleParametricTilingPass() { - PassRegistration( - "test-extract-fixed-outer-loops", - "test application of parametric tiling to the outer loops so that the " - "ranges of outer loops become static"); + PassRegistration(); } } // namespace test } // namespace mlir diff --git a/mlir/test/lib/Transforms/TestLoopUnrolling.cpp b/mlir/test/lib/Transforms/TestLoopUnrolling.cpp --- a/mlir/test/lib/Transforms/TestLoopUnrolling.cpp +++ b/mlir/test/lib/Transforms/TestLoopUnrolling.cpp @@ -33,6 +33,10 @@ class TestLoopUnrollingPass : public PassWrapper { public: + StringRef getArgument() const final { return "test-loop-unrolling"; } + StringRef getDescription() const final { + return "Tests loop unrolling transformation"; + } TestLoopUnrollingPass() = default; TestLoopUnrollingPass(const TestLoopUnrollingPass &) {} explicit TestLoopUnrollingPass(uint64_t unrollFactorParam, @@ -65,8 +69,7 @@ namespace mlir { namespace test { void registerTestLoopUnrollingPass() { - PassRegistration( - "test-loop-unrolling", "Tests loop unrolling transformation"); + PassRegistration(); } } // namespace test } // namespace mlir