From 3bab9d4eb0913e07f453361b2104f85dc0c2fc3d Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sat, 1 Jan 2022 21:31:24 +0000 Subject: [PATCH] Apply clang-tidy fixes for bugprone-copy-constructor-init to MLIR (NFC) Reviewed By: rriddle, Mogball Differential Revision: https://reviews.llvm.org/D116245 --- .../Transforms/ComprehensiveBufferizePass.cpp | 3 ++- .../SparseTensor/Transforms/SparseTensorPasses.cpp | 2 +- .../test/lib/Dialect/Affine/TestAffineDataCopy.cpp | 2 +- .../Dialect/Affine/TestAffineLoopUnswitching.cpp | 3 ++- .../lib/Dialect/Affine/TestLoopPermutation.cpp | 2 +- .../Dialect/Linalg/TestComprehensiveBufferize.cpp | 3 ++- .../Dialect/Linalg/TestLinalgCodegenStrategy.cpp | 3 ++- .../lib/Dialect/Linalg/TestLinalgDistribution.cpp | 3 ++- .../Dialect/Linalg/TestLinalgFusionTransforms.cpp | 3 ++- .../test/lib/Dialect/Linalg/TestLinalgHoisting.cpp | 2 +- .../lib/Dialect/Linalg/TestLinalgTransforms.cpp | 2 +- .../Dialect/Math/TestPolynomialApproximation.cpp | 3 ++- .../lib/Dialect/Vector/TestVectorTransforms.cpp | 27 ++++++++++++++-------- 13 files changed, 37 insertions(+), 21 deletions(-) diff --git a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp index 61a9f1b..6425c05 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp @@ -36,7 +36,8 @@ struct LinalgComprehensiveModuleBufferize LinalgComprehensiveModuleBufferize() = default; LinalgComprehensiveModuleBufferize( - const LinalgComprehensiveModuleBufferize &p) {} + const LinalgComprehensiveModuleBufferize &p) + : LinalgComprehensiveModuleBufferizeBase(p) {} void runOnOperation() override; diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp index 8404aa6..61d90c0 100644 --- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp +++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp @@ -34,7 +34,7 @@ struct SparsificationPass : public SparsificationBase { SparsificationPass() = default; SparsificationPass(const SparsificationPass &pass) - : SparsificationBase() {} + : SparsificationBase(pass) {} /// Returns parallelization strategy given on command line. SparseParallelizationStrategy parallelOption() { diff --git a/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp b/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp index df74cf7..e28b0c3 100644 --- a/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp +++ b/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp @@ -34,7 +34,7 @@ struct TestAffineDataCopy return "Tests affine data copy utility functions."; } TestAffineDataCopy() = default; - TestAffineDataCopy(const TestAffineDataCopy &pass){}; + TestAffineDataCopy(const TestAffineDataCopy &pass) : PassWrapper(pass){}; void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); diff --git a/mlir/test/lib/Dialect/Affine/TestAffineLoopUnswitching.cpp b/mlir/test/lib/Dialect/Affine/TestAffineLoopUnswitching.cpp index 542e109..533b51e 100644 --- a/mlir/test/lib/Dialect/Affine/TestAffineLoopUnswitching.cpp +++ b/mlir/test/lib/Dialect/Affine/TestAffineLoopUnswitching.cpp @@ -30,7 +30,8 @@ struct TestAffineLoopUnswitching return "Tests affine loop unswitching / if/else hoisting"; } TestAffineLoopUnswitching() = default; - TestAffineLoopUnswitching(const TestAffineLoopUnswitching &pass) {} + TestAffineLoopUnswitching(const TestAffineLoopUnswitching &pass) + : PassWrapper(pass) {} void runOnFunction() override; diff --git a/mlir/test/lib/Dialect/Affine/TestLoopPermutation.cpp b/mlir/test/lib/Dialect/Affine/TestLoopPermutation.cpp index 8a88d15..1a997dc 100644 --- a/mlir/test/lib/Dialect/Affine/TestLoopPermutation.cpp +++ b/mlir/test/lib/Dialect/Affine/TestLoopPermutation.cpp @@ -32,7 +32,7 @@ struct TestLoopPermutation return "Tests affine loop permutation utility"; } TestLoopPermutation() = default; - TestLoopPermutation(const TestLoopPermutation &pass){}; + TestLoopPermutation(const TestLoopPermutation &pass) : PassWrapper(pass){}; void runOnFunction() override; diff --git a/mlir/test/lib/Dialect/Linalg/TestComprehensiveBufferize.cpp b/mlir/test/lib/Dialect/Linalg/TestComprehensiveBufferize.cpp index 53d2412..d54948e 100644 --- a/mlir/test/lib/Dialect/Linalg/TestComprehensiveBufferize.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestComprehensiveBufferize.cpp @@ -49,7 +49,8 @@ struct TestComprehensiveFunctionBufferize TestComprehensiveFunctionBufferize() = default; TestComprehensiveFunctionBufferize( - const TestComprehensiveFunctionBufferize &pass) {} + const TestComprehensiveFunctionBufferize &pass) + : PassWrapper(pass) {} void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp index 39f8cca..d5391a1 100644 --- a/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp @@ -264,7 +264,8 @@ struct TestLinalgTileAndFuseSequencePass } TestLinalgTileAndFuseSequencePass() = default; TestLinalgTileAndFuseSequencePass( - const TestLinalgTileAndFuseSequencePass &pass){}; + const TestLinalgTileAndFuseSequencePass &pass) + : PassWrapper(pass){}; ListOption tileSizes{ *this, "tile-sizes", llvm::cl::desc("Tile sizes to use for ops"), diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgHoisting.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgHoisting.cpp index 59b13b9..4fa90ed 100644 --- a/mlir/test/lib/Dialect/Linalg/TestLinalgHoisting.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgHoisting.cpp @@ -22,7 +22,7 @@ namespace { struct TestLinalgHoisting : public PassWrapper { TestLinalgHoisting() = default; - TestLinalgHoisting(const TestLinalgHoisting &pass) {} + TestLinalgHoisting(const TestLinalgHoisting &pass) : PassWrapper(pass) {} void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp index d24de7a..51cdd87 100644 --- a/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp @@ -34,7 +34,7 @@ namespace { struct TestLinalgTransforms : public PassWrapper { TestLinalgTransforms() = default; - TestLinalgTransforms(const TestLinalgTransforms &pass) {} + TestLinalgTransforms(const TestLinalgTransforms &pass) : PassWrapper(pass) {} void getDependentDialects(DialectRegistry ®istry) const override { // clang-format off diff --git a/mlir/test/lib/Dialect/Math/TestPolynomialApproximation.cpp b/mlir/test/lib/Dialect/Math/TestPolynomialApproximation.cpp index 7cce0ef..486ea58 100644 --- a/mlir/test/lib/Dialect/Math/TestPolynomialApproximation.cpp +++ b/mlir/test/lib/Dialect/Math/TestPolynomialApproximation.cpp @@ -26,7 +26,8 @@ struct TestMathPolynomialApproximationPass : public PassWrapper { TestMathPolynomialApproximationPass() = default; TestMathPolynomialApproximationPass( - const TestMathPolynomialApproximationPass &pass) {} + const TestMathPolynomialApproximationPass &pass) + : PassWrapper(pass) {} void runOnFunction() override; void getDependentDialects(DialectRegistry ®istry) const override { diff --git a/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp b/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp index e0902db..db52be8 100644 --- a/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp +++ b/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp @@ -31,7 +31,8 @@ namespace { struct TestVectorToVectorLowering : public PassWrapper { TestVectorToVectorLowering() = default; - TestVectorToVectorLowering(const TestVectorToVectorLowering &pass) {} + TestVectorToVectorLowering(const TestVectorToVectorLowering &pass) + : PassWrapper(pass) {} StringRef getArgument() const final { return "test-vector-to-vector-lowering"; } @@ -110,7 +111,8 @@ struct TestVectorContractionLowering "dialect"; } TestVectorContractionLowering() = default; - TestVectorContractionLowering(const TestVectorContractionLowering &pass) {} + TestVectorContractionLowering(const TestVectorContractionLowering &pass) + : PassWrapper(pass) {} Option lowerToFlatMatrix{ *this, "vector-lower-matrix-intrinsics", @@ -182,7 +184,8 @@ struct TestVectorTransposeLowering "dialect"; } TestVectorTransposeLowering() = default; - TestVectorTransposeLowering(const TestVectorTransposeLowering &pass) {} + TestVectorTransposeLowering(const TestVectorTransposeLowering &pass) + : PassWrapper(pass) {} Option lowerToEltwise{ *this, "eltwise", @@ -253,7 +256,8 @@ struct TestVectorUnrollingPatterns "dialect"; } TestVectorUnrollingPatterns() = default; - TestVectorUnrollingPatterns(const TestVectorUnrollingPatterns &pass) {} + TestVectorUnrollingPatterns(const TestVectorUnrollingPatterns &pass) + : PassWrapper(pass) {} void runOnFunction() override { MLIRContext *ctx = &getContext(); RewritePatternSet patterns(ctx); @@ -312,7 +316,8 @@ struct TestVectorDistributePatterns "dialect"; } TestVectorDistributePatterns() = default; - TestVectorDistributePatterns(const TestVectorDistributePatterns &pass) {} + TestVectorDistributePatterns(const TestVectorDistributePatterns &pass) + : PassWrapper(pass) {} void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); registry.insert(); @@ -365,7 +370,8 @@ struct TestVectorToLoopPatterns return "Test lowering patterns to break up a vector op into a for loop"; } TestVectorToLoopPatterns() = default; - TestVectorToLoopPatterns(const TestVectorToLoopPatterns &pass) {} + TestVectorToLoopPatterns(const TestVectorToLoopPatterns &pass) + : PassWrapper(pass) {} void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); registry.insert(); @@ -456,7 +462,8 @@ struct TestVectorTransferFullPartialSplitPatterns } TestVectorTransferFullPartialSplitPatterns() = default; TestVectorTransferFullPartialSplitPatterns( - const TestVectorTransferFullPartialSplitPatterns &pass) {} + const TestVectorTransferFullPartialSplitPatterns &pass) + : PassWrapper(pass) {} void getDependentDialects(DialectRegistry ®istry) const override { registry.insert { TestVectorMultiReductionLoweringPatterns() = default; TestVectorMultiReductionLoweringPatterns( - const TestVectorMultiReductionLoweringPatterns &pass) {} + const TestVectorMultiReductionLoweringPatterns &pass) + : PassWrapper(pass) {} void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } @@ -544,7 +552,8 @@ struct TestVectorTransferCollapseInnerMostContiguousDims FunctionPass> { TestVectorTransferCollapseInnerMostContiguousDims() = default; TestVectorTransferCollapseInnerMostContiguousDims( - const TestVectorTransferCollapseInnerMostContiguousDims &pass) {} + const TestVectorTransferCollapseInnerMostContiguousDims &pass) + : PassWrapper(pass) {} void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); -- 2.7.4