aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
diff options
context:
space:
mode:
authorMichael Maitland <michaeltmaitland@gmail.com>2025-05-30 00:39:45 -0400
committerGitHub <noreply@github.com>2025-05-30 00:39:45 -0400
commit7454098a9ed46ca5ad310bf3ec9347eb08eba007 (patch)
tree3bb6e26269acdce13cfd804038c53540cb4386ce /mlir/lib/Bytecode/Reader/BytecodeReader.cpp
parentf5d3470d425f9ee99436bfdc0c1ae1ce03bab385 (diff)
downloadllvm-7454098a9ed46ca5ad310bf3ec9347eb08eba007.zip
llvm-7454098a9ed46ca5ad310bf3ec9347eb08eba007.tar.gz
llvm-7454098a9ed46ca5ad310bf3ec9347eb08eba007.tar.bz2
[mlir][Value] Add getNumUses, hasNUses, and hasNUsesOrMore to Value (#142084)
We already have hasOneUse. Like llvm::Value we provide helper methods to query the number of uses of a Value. Add unittests for Value, because that was missing. --------- Co-authored-by: Michael Maitland <michaelmaitland@meta.com>
Diffstat (limited to 'mlir/lib/Bytecode/Reader/BytecodeReader.cpp')
-rw-r--r--mlir/lib/Bytecode/Reader/BytecodeReader.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/mlir/lib/Bytecode/Reader/BytecodeReader.cpp b/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
index 1052946..44458d0 100644
--- a/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
+++ b/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
@@ -1993,8 +1993,7 @@ LogicalResult BytecodeReader::Impl::sortUseListOrder(Value value) {
UseListOrderStorage customOrder =
valueToUseListMap.at(value.getAsOpaquePointer());
SmallVector<unsigned, 4> shuffle = std::move(customOrder.indices);
- uint64_t numUses =
- std::distance(value.getUses().begin(), value.getUses().end());
+ uint64_t numUses = value.getNumUses();
// If the encoding was a pair of indices `(src, dst)` for every permutation,
// reconstruct the shuffle vector for every use. Initialize the shuffle vector