From ced8690d84791083f08ba3ba64862ac43ccb6590 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Wed, 29 Dec 2021 05:12:02 +0000 Subject: [PATCH] Apply clang-tidy fixes for bugprone-argument-comment to MLIR (NFC) Differential Revision: https://reviews.llvm.org/D116244 --- mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp | 4 ++-- .../Dialect/Math/Transforms/PolynomialApproximation.cpp | 2 +- mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp | 4 ++-- mlir/lib/Transforms/LoopFusion.cpp | 2 +- mlir/lib/Transforms/NormalizeMemRefs.cpp | 16 ++++++++-------- mlir/lib/Transforms/PipelineDataTransfer.cpp | 2 +- mlir/lib/Transforms/Utils/LoopUtils.cpp | 6 +++--- mlir/test/lib/Transforms/TestLoopFusion.cpp | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp index 939400e..ab22ee0 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp @@ -80,7 +80,7 @@ static OpType getSingleOpOfType(Block &block) { /// map is reindexed to `affine_map<(d0, d1, d2) -> (d2, d0, d1)>`, the second /// affine map is reindexed to `affine_map<(d0, d1) -> (d0, d1)>`. static AffineMap reindexIndexingMap(AffineMap map) { - assert(map.isProjectedPermutation(/*allowZerosInResults=*/true) && + assert(map.isProjectedPermutation(/*allowZeroInResults=*/true) && "expected projected permutation"); auto res = compressUnusedDims(map); assert(res.getNumDims() == res.getNumResults() && @@ -576,7 +576,7 @@ vectorizeAsLinalgGeneric(OpBuilder &b, LinalgOp linalgOp, // TODO: drop reliance on a specific pattern. static bool allIndexingsAreProjectedPermutation(LinalgOp op) { return llvm::all_of(op.getIndexingMaps(), [](AffineMap m) { - return m.isProjectedPermutation(/*allowZerosInResults=*/true); + return m.isProjectedPermutation(/*allowZeroInResults=*/true); }); } diff --git a/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp b/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp index a42dfe7..dc92436 100644 --- a/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp +++ b/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp @@ -421,7 +421,7 @@ LogApproximationBase::logMatchAndRewrite(Op op, PatternRewriter &rewriter, x = max(builder, x, cstMinNormPos); // Extract significant in the range [0.5,1) and exponent. - std::pair pair = frexp(builder, x, /*is_positive=*/true); + std::pair pair = frexp(builder, x, /*isPositive=*/true); x = pair.first; Value e = pair.second; diff --git a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp index 9090958..e1d2dca 100644 --- a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp +++ b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp @@ -1185,8 +1185,8 @@ void WsLoopOp::build(OpBuilder &builder, OperationState &state, ValueRange lowerBound, ValueRange upperBound, ValueRange step, ArrayRef attributes) { build(builder, state, TypeRange(), lowerBound, upperBound, step, - /*private_vars=*/ValueRange(), - /*firstprivate_vars=*/ValueRange(), /*lastprivate_vars=*/ValueRange(), + /*privateVars=*/ValueRange(), + /*firstprivateVars=*/ValueRange(), /*lastprivate_vars=*/ValueRange(), /*linear_vars=*/ValueRange(), /*linear_step_vars=*/ValueRange(), /*reduction_vars=*/ValueRange(), /*schedule_val=*/nullptr, /*schedule_chunk_var=*/nullptr, /*collapse_val=*/nullptr, diff --git a/mlir/lib/Transforms/LoopFusion.cpp b/mlir/lib/Transforms/LoopFusion.cpp index e6db0cf..56bc8e3 100644 --- a/mlir/lib/Transforms/LoopFusion.cpp +++ b/mlir/lib/Transforms/LoopFusion.cpp @@ -982,7 +982,7 @@ static Value createPrivateMemRef(AffineForOp forOp, Operation *srcStoreOpInst, replaceAllMemRefUsesWith(oldMemRef, newMemRef, {}, indexRemap, /*extraOperands=*/outerIVs, /*symbolOperands=*/{}, - /*domInstFilter=*/&*forOp.getBody()->begin()); + /*domOpFilter=*/&*forOp.getBody()->begin()); assert(succeeded(res) && "replaceAllMemrefUsesWith should always succeed here"); (void)res; diff --git a/mlir/lib/Transforms/NormalizeMemRefs.cpp b/mlir/lib/Transforms/NormalizeMemRefs.cpp index c33d1b6..d830b60 100644 --- a/mlir/lib/Transforms/NormalizeMemRefs.cpp +++ b/mlir/lib/Transforms/NormalizeMemRefs.cpp @@ -275,9 +275,9 @@ void NormalizeMemRefs::updateFunctionSignature(FuncOp funcOp, /*indexRemap=*/layoutMap, /*extraOperands=*/{}, /*symbolOperands=*/{}, - /*domInstFilter=*/nullptr, - /*postDomInstFilter=*/nullptr, - /*allowDereferencingOps=*/true, + /*domOpFilter=*/nullptr, + /*postDomOpFilter=*/nullptr, + /*allowNonDereferencingOps=*/true, /*replaceInDeallocOp=*/true))) { // If it failed (due to escapes for example), bail out. // It should never hit this part of the code because it is called by @@ -370,8 +370,8 @@ void NormalizeMemRefs::normalizeFuncOpMemRefs(FuncOp funcOp, /*indexRemap=*/layoutMap, /*extraOperands=*/{}, /*symbolOperands=*/{}, - /*domInstFilter=*/nullptr, - /*postDomInstFilter=*/nullptr, + /*domOpFilter=*/nullptr, + /*postDomOpFilter=*/nullptr, /*allowNonDereferencingOps=*/true, /*replaceInDeallocOp=*/true))) { // If it failed (due to escapes for example), bail out. Removing the @@ -419,9 +419,9 @@ void NormalizeMemRefs::normalizeFuncOpMemRefs(FuncOp funcOp, /*indexRemap=*/layoutMap, /*extraOperands=*/{}, /*symbolOperands=*/{}, - /*domInstFilter=*/nullptr, - /*postDomInstFilter=*/nullptr, - /*allowDereferencingOps=*/true, + /*domOpFilter=*/nullptr, + /*postDomOpFilter=*/nullptr, + /*allowNonDereferencingOps=*/true, /*replaceInDeallocOp=*/true))) { newOp->erase(); replacingMemRefUsesFailed = true; diff --git a/mlir/lib/Transforms/PipelineDataTransfer.cpp b/mlir/lib/Transforms/PipelineDataTransfer.cpp index 6ac8605..e32c542 100644 --- a/mlir/lib/Transforms/PipelineDataTransfer.cpp +++ b/mlir/lib/Transforms/PipelineDataTransfer.cpp @@ -110,7 +110,7 @@ static bool doubleBuffer(Value oldMemRef, AffineForOp forOp) { /*indexRemap=*/AffineMap(), /*extraOperands=*/{}, /*symbolOperands=*/{}, - /*domInstFilter=*/&*forOp.getBody()->begin()))) { + /*domOpFilter=*/&*forOp.getBody()->begin()))) { LLVM_DEBUG( forOp.emitError("memref replacement for double buffering failed")); ivModTwoOp.erase(); diff --git a/mlir/lib/Transforms/Utils/LoopUtils.cpp b/mlir/lib/Transforms/Utils/LoopUtils.cpp index 91d4a7c..9a81f1d 100644 --- a/mlir/lib/Transforms/Utils/LoopUtils.cpp +++ b/mlir/lib/Transforms/Utils/LoopUtils.cpp @@ -2882,8 +2882,8 @@ static LogicalResult generateCopy( /*extraIndices=*/{}, indexRemap, /*extraOperands=*/regionSymbols, /*symbolOperands=*/{}, - /*domInstFilter=*/&*begin, - /*postDomInstFilter=*/&*postDomFilter); + /*domOpFilter=*/&*begin, + /*postDomOpFilter=*/&*postDomFilter); *nBegin = isBeginAtStartOfBlock ? block->begin() : std::next(prevOfBegin); @@ -3258,7 +3258,7 @@ static AffineIfOp createSeparationCondition(MutableArrayRef loops, 1); unsigned fullTileLbPos, fullTileUbPos; if (!cst.getConstantBoundOnDimSize(0, /*lb=*/nullptr, - /*lbFloorDivisor=*/nullptr, + /*boundFloorDivisor=*/nullptr, /*ub=*/nullptr, &fullTileLbPos, &fullTileUbPos)) { LLVM_DEBUG(llvm::dbgs() << "Can't get constant diff pair for a loop\n"); diff --git a/mlir/test/lib/Transforms/TestLoopFusion.cpp b/mlir/test/lib/Transforms/TestLoopFusion.cpp index 30de8eb..7dc40e0 100644 --- a/mlir/test/lib/Transforms/TestLoopFusion.cpp +++ b/mlir/test/lib/Transforms/TestLoopFusion.cpp @@ -186,7 +186,7 @@ void TestLoopFusion::runOnFunction() { // Try to fuse all combinations of src/dst loop nests in 'depthToLoops'. } while (iterateLoops(depthToLoops, testLoopFusionTransformation, - /*return_on_change=*/true)); + /*returnOnChange=*/true)); return; } -- 2.7.4