[PATCH] D87494: [WIP] Improve LSR debug-info

Markus Lavin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 00:40:44 PDT 2020


markus added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:5884
+    MaybeDead.insert(&PN);
+    if (collectCyclicDead(PN.getIncomingValueForBlock(L->getHeader()), &PN,
+                          MaybeDead)) {
----------------
markus wrote:
> There must be a better way to do this. Perhaps we can modify `DeleteDeadPHIs` to accept an additional `std::function` argument that replaces the `salvageDebugInfo` call. It would still default to `salvageDebugInfo` but would allow us to pass a lambda here that does the SCEV comparison (and possible replace) on the dbg-uses right before an instruction is about to be removed. 
Actually I see that commit `37b96d51d0cfc82a64598aaae2a567fa77e44de9` introduced a `AboutToDeleteCallback` that seem to serve exactly this purpose. We just need to expose it a bit further up in `DeleteDeadPHIs`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87494



More information about the llvm-commits mailing list