Repository navigation
[mlir][NFC] Remove internal linkage from reshape op helper templates - #214759
Merged
Merged
Conversation
Another case of the cleanup done for llvm#208001, which enabled -Wunused-template under -Wall. Both helpers are `static` in ReshapeOpsUtils.h, which reaches many TUs via Linalg.h, Tensor.h and MemRef.h, so clang warns wherever they are not instantiated. Dropping `static` gives them vague linkage.
|
@llvm/pr-subscribers-mlir Author: Aditya Medhane (flash1729) ChangesAnother case of the cleanup done for #208001, which enabled -Wunused-template under -Wall. Both helpers are 1 Files Affected:
diff --git a/mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h b/mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h
index 2e8c0e269995e..6f58ed48fd64f 100644
--- a/mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h
+++ b/mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h
@@ -84,8 +84,8 @@ bool isReassociationValid(ArrayRef<AffineMap> reassociation,
int *invalidIndex = nullptr);
template <typename ReshapeOpTy, typename InverseReshapeOpTy>
-static OpFoldResult foldReshapeOp(ReshapeOpTy reshapeOp,
- ArrayRef<Attribute> operands) {
+OpFoldResult foldReshapeOp(ReshapeOpTy reshapeOp,
+ ArrayRef<Attribute> operands) {
// Fold identity reshape.
if (reshapeOp.getSrcType() == reshapeOp.getType())
return reshapeOp.getSrc();
@@ -140,8 +140,8 @@ static OpFoldResult foldReshapeOp(ReshapeOpTy reshapeOp,
/// Common verifier for reshape-like types. Fills `expandedType` and
///`collapsedType` with the proper `src` or `result` type.
template <typename Op, typename T>
-static LogicalResult verifyReshapeLikeTypes(Op op, T expandedType,
- T collapsedType, bool isExpansion) {
+LogicalResult verifyReshapeLikeTypes(Op op, T expandedType, T collapsedType,
+ bool isExpansion) {
unsigned expandedRank = expandedType.getRank();
unsigned collapsedRank = collapsedType.getRank();
|
makslevental
approved these changes
Aug 11, 2026
hulxv
pushed a commit
that referenced
this pull request
Aug 12, 2026
…214759) Another case of the cleanup done for #208001, which enabled -Wunused-template under -Wall. Both helpers are `static` in ReshapeOpsUtils.h, which reaches many TUs via Linalg.h, Tensor.h and MemRef.h, so clang warns wherever they are not instantiated. Dropping `static` gives them vague linkage.
zhangweize9-cyber
pushed a commit
to zhangweize9-cyber/llvm-project
that referenced
this pull request
Aug 16, 2026
…lvm#214759) Another case of the cleanup done for llvm#208001, which enabled -Wunused-template under -Wall. Both helpers are `static` in ReshapeOpsUtils.h, which reaches many TUs via Linalg.h, Tensor.h and MemRef.h, so clang warns wherever they are not instantiated. Dropping `static` gives them vague linkage.
carlobertolli
pushed a commit
to carlobertolli/llvm-project
that referenced
this pull request
Aug 18, 2026
…lvm#214759) Another case of the cleanup done for llvm#208001, which enabled -Wunused-template under -Wall. Both helpers are `static` in ReshapeOpsUtils.h, which reaches many TUs via Linalg.h, Tensor.h and MemRef.h, so clang warns wherever they are not instantiated. Dropping `static` gives them vague linkage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Another case of the cleanup done for #208001, which enabled -Wunused-template under -Wall. Both helpers are
staticin ReshapeOpsUtils.h, which reaches many TUs via Linalg.h, Tensor.h and MemRef.h, so clang warns wherever they are not instantiated. Droppingstaticgives them vague linkage.