[PATCH] D118455: [DebugInfo][InstrRef][NFC] Cache some PHI resolutions

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 28 10:34:20 PST 2022


dblaikie added inline comments.


================
Comment at: llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp:3416-3417
     // block as the Def.
+    SeenDbgPHIs.insert({&Here, ValueIDNum::fromU64(AvailIt->second)});
     return ValueIDNum::fromU64(AvailIt->second);
   }
----------------
Given the need to touch every return from this function, and they're fairly spread out - might be good to refactor the non-cache-hit part of the function into another function, call that from the caching version and only have to have one `SeenDbgPHIs.insert` call that then ends up relatively close to the `SeenDbgPHIs` lookup code too?

(& I guess operations in this function invalidate the `SeenDbgPHIs` iterator, otherwise you could use that (possibly even call `insert`) later on to save the extra lookup)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118455



More information about the llvm-commits mailing list