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

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 12:28:04 PDT 2020


vsk added a comment.

Thanks Orlando. We've discussed the pros & cons of deleting undef DW_OP_deref dbg.values in D85555 <https://reviews.llvm.org/D85555>. While there are cases where we do want to mark a location as 'undef' (say, after a dead store), on balance I think this is the better approach.



================
Comment at: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:104
 struct AllocaInfo {
+  using DbgUserVec = SmallVector<DbgVariableIntrinsic *, 8>;
+
----------------
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?


================
Comment at: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:684
   // Remove alloca's dbg.declare instrinsics from the function.
-  for (auto &Declares : AllocaDbgDeclares)
+  for (auto &Declares : AllocaDbgUsers) {
     for (auto *DII : Declares)
----------------
nit, 'auto &DbgUsers'?


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

https://reviews.llvm.org/D89810



More information about the llvm-commits mailing list