[PATCH] D58073: [GlobalISel][NFC]: Add interface to reserve memory in GISelWorklist

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 11 13:50:32 PST 2019


arsenm added inline comments.


================
Comment at: include/llvm/CodeGen/GlobalISel/GISelWorkList.h:42
 
+  void reserve(unsigned Size) {
+    if (Size > N) {
----------------
size_t


================
Comment at: lib/CodeGen/GlobalISel/Combiner.cpp:114
     Changed = false;
+    unsigned MF_Size = 0;
+    for (auto &MBB : MF)
----------------
size_t


================
Comment at: lib/CodeGen/GlobalISel/Combiner.cpp:115
+    unsigned MF_Size = 0;
+    for (auto &MBB : MF)
+      MF_Size += MBB.size();
----------------
It seems weird to me to scan over the function just to estimate this. Can you start with some large constant and increase with each block as it's seen?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58073/new/

https://reviews.llvm.org/D58073





More information about the llvm-commits mailing list