[Mlir-commits] [mlir] 2c4f0e7 - [mlir] Replace SmallSet with SmallPtrSet (NFC) (#154265)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Aug 19 07:11:51 PDT 2025
Author: Kazu Hirata
Date: 2025-08-19T07:11:47-07:00
New Revision: 2c4f0e7ac6d3a8807651ea494f9087dad16de277
URL: https://github.com/llvm/llvm-project/commit/2c4f0e7ac6d3a8807651ea494f9087dad16de277
DIFF: https://github.com/llvm/llvm-project/commit/2c4f0e7ac6d3a8807651ea494f9087dad16de277.diff
LOG: [mlir] Replace SmallSet with SmallPtrSet (NFC) (#154265)
This patch replaces SmallSet<T *, N> with SmallPtrSet<T *, N>. Note
that SmallSet.h "redirects" SmallSet to SmallPtrSet for pointer
element types:
template <typename PointeeType, unsigned N>
class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N>
{};
We only have 30 instances that rely on this "redirection". Since the
redirection doesn't improve readability, this patch replaces SmallSet
with SmallPtrSet for pointer element types.
I'm planning to remove the redirection eventually.
Added:
Modified:
mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
index ddc64ea7ebf9a..91e37dd9ac36e 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
@@ -248,7 +248,7 @@ LogicalResult AsyncRuntimeRefCountingPass::addDropRefAfterLastUse(Value value) {
Region *definingRegion = value.getParentRegion();
// Last users of the `value` inside all blocks where the value dies.
- llvm::SmallSet<Operation *, 4> lastUsers;
+ llvm::SmallPtrSet<Operation *, 4> lastUsers;
// Find blocks in the `definingRegion` that have users of the `value` (if
// there are multiple users in the block, which one will be selected is
More information about the Mlir-commits
mailing list