Skip to content

Commit

Permalink
PR #52466: [tensorflow/compiler/mlir/hlo/lib/Analysis/userange_analys…
Browse files Browse the repository at this point in the history
…is.cc] Add calls to `reserve()` before populating vector

Imported from GitHub PR tensorflow/tensorflow#52466

tensorflow/tensorflow#51739 (comment) told me to split the larger PR into one PR per file; thus this (thanks `bash`, `git` and `gh`!)
Copybara import of the project:

--
cc99fd8ad768f2354674d130357a3efcce9ba475 by Samuel Marks <807580+SamuelMarks@users.noreply.github.com>:

[tensorflow/compiler/mlir/hlo/lib/Analysis/userange_analysis.cc] Add calls to `reserve()` before populating vectors

PiperOrigin-RevId: 405540491
  • Loading branch information
SamuelMarks authored and TensorFlow MLIR Team committed Oct 26, 2021
1 parent cb34357 commit 841db07
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Analysis/userange_analysis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,8 @@ size_t UserangeAnalysis::unwrapId(size_t id) const { return id / 2; }

void UserangeAnalysis::dump(raw_ostream &os) {
os << "// ---- UserangeAnalysis -----\n";
SmallVector<Value> values;
llvm::SmallVector<Value> values;
values.reserve(useIntervalMap.size());
for (auto const &item : useIntervalMap) {
values.push_back(item.first);
}
Expand Down

0 comments on commit 841db07

Please sign in to comment.