[Mlir-commits] [mlir] 9c62446 - [mlir] Remove redundant control flow statements (NFC) (#141184)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu May 22 22:36:32 PDT 2025
Author: Kazu Hirata
Date: 2025-05-22T22:36:29-07:00
New Revision: 9c62446024f50cbf3f8722d11f71e31baae3a051
URL: https://github.com/llvm/llvm-project/commit/9c62446024f50cbf3f8722d11f71e31baae3a051
DIFF: https://github.com/llvm/llvm-project/commit/9c62446024f50cbf3f8722d11f71e31baae3a051.diff
LOG: [mlir] Remove redundant control flow statements (NFC) (#141184)
Added:
Modified:
mlir/include/mlir/Analysis/DataFlow/DenseAnalysis.h
mlir/include/mlir/Analysis/DataFlowFramework.h
mlir/lib/Dialect/Mesh/IR/MeshOps.cpp
mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
mlir/test/lib/Dialect/Linalg/TestLinalgRankReduceContractionOps.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Analysis/DataFlow/DenseAnalysis.h b/mlir/include/mlir/Analysis/DataFlow/DenseAnalysis.h
index 7ecde7f39415c..8bcfe51ad7cd1 100644
--- a/mlir/include/mlir/Analysis/DataFlow/DenseAnalysis.h
+++ b/mlir/include/mlir/Analysis/DataFlow/DenseAnalysis.h
@@ -125,7 +125,7 @@ class AbstractDenseForwardDataFlowAnalysis : public DataFlowAnalysis {
/// Visit an operation. If this analysis can confirm that lattice content
/// of lattice anchors around operation are necessarily identical, join
/// them into the same equivalent class.
- virtual void buildOperationEquivalentLatticeAnchor(Operation *op) { return; }
+ virtual void buildOperationEquivalentLatticeAnchor(Operation *op) {}
/// Propagate the dense lattice forward along the control flow edge from
/// `regionFrom` to `regionTo` regions of the `branch` operation. `nullopt`
@@ -386,7 +386,7 @@ class AbstractDenseBackwardDataFlowAnalysis : public DataFlowAnalysis {
/// Visit an operation. If this analysis can confirm that lattice content
/// of lattice anchors around operation are necessarily identical, join
/// them into the same equivalent class.
- virtual void buildOperationEquivalentLatticeAnchor(Operation *op) { return; }
+ virtual void buildOperationEquivalentLatticeAnchor(Operation *op) {}
/// Propagate the dense lattice backwards along the control flow edge from
/// `regionFrom` to `regionTo` regions of the `branch` operation. `nullopt`
diff --git a/mlir/include/mlir/Analysis/DataFlowFramework.h b/mlir/include/mlir/Analysis/DataFlowFramework.h
index caf978a51fd8e..49862927caff2 100644
--- a/mlir/include/mlir/Analysis/DataFlowFramework.h
+++ b/mlir/include/mlir/Analysis/DataFlowFramework.h
@@ -622,7 +622,7 @@ class DataFlowAnalysis {
/// This function will union lattice anchor to same equivalent class if the
/// analysis can determine the lattice content of lattice anchor is
/// necessarily identical under the corrensponding lattice type.
- virtual void initializeEquivalentLatticeAnchor(Operation *top) { return; }
+ virtual void initializeEquivalentLatticeAnchor(Operation *top) {}
protected:
/// Create a dependency between the given analysis state and lattice anchor
diff --git a/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp b/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp
index 2bdb58892937f..304cb55a35086 100644
--- a/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp
+++ b/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp
@@ -314,7 +314,6 @@ void mlir::mesh::maybeInsertTargetShardingAnnotation(MeshSharding sharding,
newShardOp.getSharding(),
/*annotate_for_users*/ true);
rewriter.replaceAllUsesExcept(newShardOp, newShardOp2, newShardOp2);
- return;
}
void mlir::mesh::maybeInsertTargetShardingAnnotation(MeshSharding sharding,
diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
index 9227b0f8fd5b9..f9db5dcb88b4c 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
@@ -463,7 +463,6 @@ struct TosaValidation : public tosa::impl::TosaValidationBase<TosaValidation> {
depth++;
getMaxNestedDepth(op, depth);
- return;
}
bool levelCheckMaxNesting(Operation *op) {
diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgRankReduceContractionOps.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgRankReduceContractionOps.cpp
index 750ba6b5d9872..d7b7c6fe90c90 100644
--- a/mlir/test/lib/Dialect/Linalg/TestLinalgRankReduceContractionOps.cpp
+++ b/mlir/test/lib/Dialect/Linalg/TestLinalgRankReduceContractionOps.cpp
@@ -51,7 +51,6 @@ struct TestLinalgRankReduceContractionOps
linalg::populateContractionOpRankReducingPatterns(patterns);
if (failed(applyPatternsGreedily(funcOp.getBody(), std::move(patterns))))
return signalPassFailure();
- return;
}
};
More information about the Mlir-commits
mailing list