[PATCH] D73725: [DebugInfo] Avoid a quadratic-complexity corner case in LiveDebugValues

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 10:30:32 PST 2020


aprantl added a comment.

We don't have an existing unit test for LexicalScopes that generates IR manually and tests a few common queries, do we?



================
Comment at: llvm/lib/CodeGen/LexicalScopes.cpp:299
+  for (auto &R : InsnRanges) {
+    auto CurMBBIt = R.first->getParent()->getIterator();
+    auto EndBBIt = R.second->getParent()->getIterator();
----------------
Perhaps I'm missing something, but this looks like a really complicated way of writing a for(;;) loop?


================
Comment at: llvm/lib/CodeGen/LexicalScopes.cpp:327
+  getMachineBasicBlocks(DL, Set);
+  return Set.count(MBB) != 0;
 }
----------------
`return Set.count(MBB);`

is idiomatic, I think.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73725





More information about the llvm-commits mailing list