[PATCH] D118460: [DebugInfo][InstrRef] Use a depth-first search to reduce the lifetime of tracking information

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 2 04:35:50 PST 2022


jmorse added inline comments.


================
Comment at: llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp:2986
+    auto DILocIt = ScopeToDILocation.find(WS);
+    if (HighestDFSIn <= WS->getDFSIn() && DILocIt != ScopeToDILocation.end()) {
+      const DILocation *DILoc = DILocIt->second;
----------------
Orlando wrote:
> Repeating offline discussion so it's noted on the review -- it looks as though it might be possible to simplify this by removing the `HighestDFSIn` check and moving the body of this block into the `if (ChildNum < (ssize_t)Children.size()) { ... }` block below.
I went to implement this and then realised: the block you mention only runs for scopes where there are child scopes, and the "else" block only runs after child scopes are visited. I think this counter/ratchet needs to continue to exist so that scopes are always visited, and in the correct order.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118460



More information about the llvm-commits mailing list