[PATCH] D89810: [mem2reg] Remove dbg.values describing contents of dead allocas

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 02:44:30 PDT 2020


Orlando added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:104
 struct AllocaInfo {
+  using DbgUserVec = SmallVector<DbgVariableIntrinsic *, 8>;
+
----------------
vsk wrote:
> Considering that this replaces a TinyPtrVector which "is specialized for cases where there are normally 0 or 1 element in a vector", perhaps we ought to reserve less memory?
Makes sense, done. For added confidence, in a clang-3.4 RelWithDebInfo build using trunk I found that DbgUsers.size() is 0 or 1 for over 90% of `AnalyzeAlloca` calls, so 1 seems like a good choice.


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

https://reviews.llvm.org/D89810



More information about the llvm-commits mailing list