From ffb9743a848192b89f6552fae8e7f982b8f8dd3e Mon Sep 17 00:00:00 2001 From: Adam Siemieniuk Date: Wed, 19 Feb 2025 12:29:11 +0100 Subject: [PATCH] [mlir][dlti] Fix query keys preallocation Fixes upfront space allocation after #126716 --- mlir/lib/Dialect/DLTI/DLTI.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mlir/lib/Dialect/DLTI/DLTI.cpp b/mlir/lib/Dialect/DLTI/DLTI.cpp index b057554c40d8c..70e05cb4cb383 100644 --- a/mlir/lib/Dialect/DLTI/DLTI.cpp +++ b/mlir/lib/Dialect/DLTI/DLTI.cpp @@ -571,7 +571,8 @@ FailureOr dlti::query(Operation *op, ArrayRef keys, return failure(); MLIRContext *ctx = op->getContext(); - SmallVector entryKeys(keys.size()); + SmallVector entryKeys; + entryKeys.reserve(keys.size()); for (StringRef key : keys) entryKeys.push_back(StringAttr::get(ctx, key));