-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[mlir] Remove redundant typename (NFC) #166108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kazutakahirata
merged 1 commit into
llvm:main
from
kazutakahirata:cleanup_20251102a_clang_tidy_readability-redundant-typename_mlir
Nov 2, 2025
Merged
[mlir] Remove redundant typename (NFC) #166108
kazutakahirata
merged 1 commit into
llvm:main
from
kazutakahirata:cleanup_20251102a_clang_tidy_readability-redundant-typename_mlir
Nov 2, 2025
Conversation
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
Identified with readability-redundant-typename.
|
@llvm/pr-subscribers-mlir-sparse @llvm/pr-subscribers-mlir-core Author: Kazu Hirata (kazutakahirata) ChangesIdentified with readability-redundant-typename. Full diff: https://github.com/llvm/llvm-project/pull/166108.diff 7 Files Affected:
diff --git a/mlir/include/mlir/Dialect/GPU/IR/GPUDialect.h b/mlir/include/mlir/Dialect/GPU/IR/GPUDialect.h
index 7b53594a1c8e2..a9886d1f21ca0 100644
--- a/mlir/include/mlir/Dialect/GPU/IR/GPUDialect.h
+++ b/mlir/include/mlir/Dialect/GPU/IR/GPUDialect.h
@@ -178,8 +178,8 @@ enum class SparseHandleKind { SpMat, DnTensor, SpGEMMOp };
class SparseDnTensorHandleType
: public Type::TypeBase<SparseDnTensorHandleType, Type, TypeStorage> {
public:
- using Base = typename Type::TypeBase<SparseDnTensorHandleType, Type,
- TypeStorage>::Base;
+ using Base =
+ Type::TypeBase<SparseDnTensorHandleType, Type, TypeStorage>::Base;
using Base::Base;
static constexpr StringLiteral name = "gpu.sparse.dntensor_handle";
@@ -188,8 +188,7 @@ class SparseDnTensorHandleType
class SparseSpMatHandleType
: public Type::TypeBase<SparseSpMatHandleType, Type, TypeStorage> {
public:
- using Base =
- typename Type::TypeBase<SparseSpMatHandleType, Type, TypeStorage>::Base;
+ using Base = Type::TypeBase<SparseSpMatHandleType, Type, TypeStorage>::Base;
using Base::Base;
static constexpr StringLiteral name = "gpu.sparse.spmat_handle";
@@ -198,8 +197,8 @@ class SparseSpMatHandleType
class SparseSpGEMMOpHandleType
: public Type::TypeBase<SparseSpGEMMOpHandleType, Type, TypeStorage> {
public:
- using Base = typename Type::TypeBase<SparseSpGEMMOpHandleType, Type,
- TypeStorage>::Base;
+ using Base =
+ Type::TypeBase<SparseSpGEMMOpHandleType, Type, TypeStorage>::Base;
using Base::Base;
static constexpr StringLiteral name = "gpu.sparse.spgemmop_handle";
diff --git a/mlir/include/mlir/IR/BlockSupport.h b/mlir/include/mlir/IR/BlockSupport.h
index f9fbef2f3753f..a2e080ef4f63f 100644
--- a/mlir/include/mlir/IR/BlockSupport.h
+++ b/mlir/include/mlir/IR/BlockSupport.h
@@ -206,12 +206,12 @@ namespace ilist_detail {
// operations to have trailing Regions without a circular include
// dependence.
template <>
-struct SpecificNodeAccess<
- typename compute_node_options<::mlir::Operation>::type> : NodeAccess {
+struct SpecificNodeAccess<compute_node_options<::mlir::Operation>::type>
+ : NodeAccess {
protected:
- using OptionsT = typename compute_node_options<mlir::Operation>::type;
- using pointer = typename OptionsT::pointer;
- using const_pointer = typename OptionsT::const_pointer;
+ using OptionsT = compute_node_options<mlir::Operation>::type;
+ using pointer = OptionsT::pointer;
+ using const_pointer = OptionsT::const_pointer;
using node_type = ilist_node_impl<OptionsT>;
static node_type *getNodePtr(pointer N);
diff --git a/mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp b/mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp
index ba57155ab9b45..03ed4d51cc744 100644
--- a/mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp
+++ b/mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp
@@ -240,8 +240,7 @@ struct CmpFOpLowering : public ConvertOpToLLVMPattern<arith::CmpFOp> {
struct SelectOpOneToNLowering : public ConvertOpToLLVMPattern<arith::SelectOp> {
using ConvertOpToLLVMPattern::ConvertOpToLLVMPattern;
- using Adaptor =
- typename ConvertOpToLLVMPattern<arith::SelectOp>::OneToNOpAdaptor;
+ using Adaptor = ConvertOpToLLVMPattern<arith::SelectOp>::OneToNOpAdaptor;
LogicalResult
matchAndRewrite(arith::SelectOp op, Adaptor adaptor,
diff --git a/mlir/lib/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.cpp b/mlir/lib/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.cpp
index 798d8b04eed76..b75968eb31c58 100644
--- a/mlir/lib/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.cpp
+++ b/mlir/lib/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.cpp
@@ -137,8 +137,7 @@ static SmallVector<Value> flattenValues(ArrayRef<ValueRange> values) {
/// op to llvm.br.
struct BranchOpLowering : public ConvertOpToLLVMPattern<cf::BranchOp> {
using ConvertOpToLLVMPattern<cf::BranchOp>::ConvertOpToLLVMPattern;
- using Adaptor =
- typename ConvertOpToLLVMPattern<cf::BranchOp>::OneToNOpAdaptor;
+ using Adaptor = ConvertOpToLLVMPattern<cf::BranchOp>::OneToNOpAdaptor;
LogicalResult
matchAndRewrite(cf::BranchOp op, Adaptor adaptor,
@@ -163,8 +162,7 @@ struct BranchOpLowering : public ConvertOpToLLVMPattern<cf::BranchOp> {
/// branch op to llvm.cond_br.
struct CondBranchOpLowering : public ConvertOpToLLVMPattern<cf::CondBranchOp> {
using ConvertOpToLLVMPattern<cf::CondBranchOp>::ConvertOpToLLVMPattern;
- using Adaptor =
- typename ConvertOpToLLVMPattern<cf::CondBranchOp>::OneToNOpAdaptor;
+ using Adaptor = ConvertOpToLLVMPattern<cf::CondBranchOp>::OneToNOpAdaptor;
LogicalResult
matchAndRewrite(cf::CondBranchOp op, Adaptor adaptor,
@@ -204,7 +202,7 @@ struct SwitchOpLowering : public ConvertOpToLLVMPattern<cf::SwitchOp> {
using ConvertOpToLLVMPattern<cf::SwitchOp>::ConvertOpToLLVMPattern;
LogicalResult
- matchAndRewrite(cf::SwitchOp op, typename cf::SwitchOp::Adaptor adaptor,
+ matchAndRewrite(cf::SwitchOp op, cf::SwitchOp::Adaptor adaptor,
ConversionPatternRewriter &rewriter) const override {
// Get or convert default block.
FailureOr<Block *> convertedDefaultBlock = getConvertedBlock(
diff --git a/mlir/lib/Conversion/MathToROCDL/MathToROCDL.cpp b/mlir/lib/Conversion/MathToROCDL/MathToROCDL.cpp
index a2dfc12cc9d63..a922338176f11 100644
--- a/mlir/lib/Conversion/MathToROCDL/MathToROCDL.cpp
+++ b/mlir/lib/Conversion/MathToROCDL/MathToROCDL.cpp
@@ -68,7 +68,7 @@ struct ClampFOpConversion final
return LLVM::detail::handleMultidimensionalVectors(
op.getOperation(), adaptor.getOperands(), *getTypeConverter(),
[&](Type llvm1DVectorTy, ValueRange operands) -> Value {
- typename math::ClampFOp::Adaptor adaptor(operands);
+ math::ClampFOp::Adaptor adaptor(operands);
return ROCDL::FMed3Op::create(rewriter, op.getLoc(), llvm1DVectorTy,
adaptor.getValue(), adaptor.getMin(),
adaptor.getMax());
diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
index 7a26cd301eb99..1fbcf5fdc68db 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
@@ -1050,7 +1050,7 @@ class SparseInsertConverter : public OpConversionPattern<tensor::InsertOp> {
/// Sparse codegen rule for position accesses.
class SparseToPositionsConverter : public OpConversionPattern<ToPositionsOp> {
public:
- using OpAdaptor = typename ToPositionsOp::Adaptor;
+ using OpAdaptor = ToPositionsOp::Adaptor;
using OpConversionPattern<ToPositionsOp>::OpConversionPattern;
LogicalResult
matchAndRewrite(ToPositionsOp op, OneToNOpAdaptor adaptor,
@@ -1073,7 +1073,7 @@ class SparseToPositionsConverter : public OpConversionPattern<ToPositionsOp> {
class SparseToCoordinatesConverter
: public OpConversionPattern<ToCoordinatesOp> {
public:
- using OpAdaptor = typename ToCoordinatesOp::Adaptor;
+ using OpAdaptor = ToCoordinatesOp::Adaptor;
using OpConversionPattern<ToCoordinatesOp>::OpConversionPattern;
LogicalResult
matchAndRewrite(ToCoordinatesOp op, OneToNOpAdaptor adaptor,
@@ -1099,7 +1099,7 @@ class SparseToCoordinatesConverter
class SparseToCoordinatesBufferConverter
: public OpConversionPattern<ToCoordinatesBufferOp> {
public:
- using OpAdaptor = typename ToCoordinatesBufferOp::Adaptor;
+ using OpAdaptor = ToCoordinatesBufferOp::Adaptor;
using OpConversionPattern<ToCoordinatesBufferOp>::OpConversionPattern;
LogicalResult
matchAndRewrite(ToCoordinatesBufferOp op, OneToNOpAdaptor adaptor,
@@ -1121,7 +1121,7 @@ class SparseToCoordinatesBufferConverter
/// Sparse codegen rule for value accesses.
class SparseToValuesConverter : public OpConversionPattern<ToValuesOp> {
public:
- using OpAdaptor = typename ToValuesOp::Adaptor;
+ using OpAdaptor = ToValuesOp::Adaptor;
using OpConversionPattern<ToValuesOp>::OpConversionPattern;
LogicalResult
matchAndRewrite(ToValuesOp op, OneToNOpAdaptor adaptor,
diff --git a/mlir/lib/IR/Operation.cpp b/mlir/lib/IR/Operation.cpp
index ce421f4bf7e0e..8212d6d3d1eba 100644
--- a/mlir/lib/IR/Operation.cpp
+++ b/mlir/lib/IR/Operation.cpp
@@ -463,28 +463,26 @@ void Operation::updateOrderIfNecessary() {
//===----------------------------------------------------------------------===//
auto llvm::ilist_detail::SpecificNodeAccess<
- typename llvm::ilist_detail::compute_node_options<
- ::mlir::Operation>::type>::getNodePtr(pointer n) -> node_type * {
+ llvm::ilist_detail::compute_node_options<::mlir::Operation>::type>::
+ getNodePtr(pointer n) -> node_type * {
return NodeAccess::getNodePtr<OptionsT>(n);
}
auto llvm::ilist_detail::SpecificNodeAccess<
- typename llvm::ilist_detail::compute_node_options<
- ::mlir::Operation>::type>::getNodePtr(const_pointer n)
- -> const node_type * {
+ llvm::ilist_detail::compute_node_options<::mlir::Operation>::type>::
+ getNodePtr(const_pointer n) -> const node_type * {
return NodeAccess::getNodePtr<OptionsT>(n);
}
auto llvm::ilist_detail::SpecificNodeAccess<
- typename llvm::ilist_detail::compute_node_options<
- ::mlir::Operation>::type>::getValuePtr(node_type *n) -> pointer {
+ llvm::ilist_detail::compute_node_options<::mlir::Operation>::type>::
+ getValuePtr(node_type *n) -> pointer {
return NodeAccess::getValuePtr<OptionsT>(n);
}
auto llvm::ilist_detail::SpecificNodeAccess<
- typename llvm::ilist_detail::compute_node_options<
- ::mlir::Operation>::type>::getValuePtr(const node_type *n)
- -> const_pointer {
+ llvm::ilist_detail::compute_node_options<::mlir::Operation>::type>::
+ getValuePtr(const node_type *n) -> const_pointer {
return NodeAccess::getValuePtr<OptionsT>(n);
}
|
kuhar
approved these changes
Nov 2, 2025
DEBADRIBASAK
pushed a commit
to DEBADRIBASAK/llvm-project
that referenced
this pull request
Nov 3, 2025
Identified with readability-redundant-typename.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Identified with readability-redundant-typename.