[PATCH] D70672: [DebugInfo] Don't sink DBG_VALUEs past other DBG_VALUEs of the same variable location

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 16:22:55 PST 2019


aprantl accepted this revision.
aprantl added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/CodeGen/MachineSink.cpp:117
+    /// debug instructions to sink.
+    DenseMap<unsigned, TinyPtrVector<SeenDbgUser>> SeenDbgUsers;
+
----------------
jmorse wrote:
> aprantl wrote:
> > I have a suspicion that on average, this DenseMap will have very few entries since it contains registers that hold variable values. Would it make sense to use a SmallDenseMap here? Or does it not because the DenseMap is being reused?
> I'd suggest the latter; assuming the concern is memory size, there's only one instance of this field per Pass, so it shouldn't consume too much memory.
> 
> (NB, I couldn't immediately find any documentation on SmallDenseMap, so I assume its purpose is memory conservation rather than a performance improvement).
The reuse argument makes sense to me.


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

https://reviews.llvm.org/D70672





More information about the llvm-commits mailing list