Skip to content

Commit c6a907a

Browse files
authored
[mlir][dlti] Fix query keys preallocation (#127786)
Fixes upfront space allocation after #126716
1 parent 3ce2e4d commit c6a907a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/lib/Dialect/DLTI/DLTI.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@ FailureOr<Attribute> dlti::query(Operation *op, ArrayRef<StringRef> keys,
571571
return failure();
572572

573573
MLIRContext *ctx = op->getContext();
574-
SmallVector<DataLayoutEntryKey> entryKeys(keys.size());
574+
SmallVector<DataLayoutEntryKey> entryKeys;
575+
entryKeys.reserve(keys.size());
575576
for (StringRef key : keys)
576577
entryKeys.push_back(StringAttr::get(ctx, key));
577578

0 commit comments

Comments
 (0)