[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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user