[PATCH] D83236: [DWARF] Add cutoff guarding validThroughout to avoid near-quadratic behaviour

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 7 04:32:10 PDT 2020


jmorse marked an inline comment as done.
jmorse added a comment.

In D83236#2133902 <https://reviews.llvm.org/D83236#2133902>, @dblaikie wrote:

> Could the algorithm be changed to do validThroughout of all variable fragments in a single pass together?


This is probably do-able, although I'm generally unfamiliar with the DWARF emission code. Right now we iterate over variable entities and call validThroughout for those that might be single-locations; we would need to pivot to iterate over variable entities collecting those that _might_ be single-location, then calling validThroughout once for that set. My preference is to fold this problem into the work that @Orlando is doing though -- his patch is already solving this problem (intersection of scope and variable-location range) in one context, we should be able to re-purpose it to solve this one too.

(Most of my motivation for this patch is the upcoming branch for LLVM11, I'd like to get a limit on this, then work towards doing it more efficiently)



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h:598
+      const DbgValueHistoryMap::Entries &Entries,
+      SmallPtrSetImpl<const MachineBasicBlock *> &VeryLargeBlocks);
 
----------------
aprantl wrote:
> Not very important, but: Assuming that `VeryLargeBlocks` will only be populated in the pathological case, micro-optimizing with a *Small*PtrSet seems unnecessary. Perhaps it's more memory-efficient on average to just use a DenseSet?
Sounds fair, I'll fold that change in,


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83236





More information about the llvm-commits mailing list