[PATCH] D44610: [SelectionDAG] Support multiple dangling debug info for one value

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 19 08:56:00 PDT 2018


rnk added a comment.

Thanks, this seems like an important fix. :) Tons of dbg.values for redundant inlined copies of `this` use the same base value.



================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h:120
+  /// DanglingDebugInfoVector - Helper type for DanglingDebugInfoMap.
+  typedef SmallVector<DanglingDebugInfo, 4> DanglingDebugInfoVector;
+
----------------
Embedding SmallVector in DenseMap is usually an efficiency trap. DenseMap stores keys and values in the table, not in separate allocations, so the value of every unfilled hashtable entry is wasted. Even then, filled slots typically have one dbg.value.

TinyPtrVector was created for this use case, but it looks like the elements are not pointers so it will not work.

I guess I'd suggest using std::vector or `SmallVector<DangingDebugInfo, 0>` to minimize wasted inline storage.


Repository:
  rL LLVM

https://reviews.llvm.org/D44610





More information about the llvm-commits mailing list