[PATCH] D98644: [DebugInfo] Fix incorrect handling of variadic salvaging in Loop Strength Reduce

Markus Lavin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 7 05:35:29 PDT 2021


markus added a comment.

Thanks for the test case. I have verified that it fails as expected without this patch (with D91722 <https://reviews.llvm.org/D91722> applied).

In general this LGTM with the caveat that I am a bit rusty and this code has been modified a few times since my original patch.



================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:5892
+    DVI->setRawLocation(DbgValueToLocation[DVI].second);
+    DVI->setExpression(DbgDIExpr);
+    assert(DVI->isUndef() && "dbg.value with non-undef location should not "
----------------
Is it really safe to always refresh from the map here? Isn't there a risk that we restore an old pre-LSR location that is no longer valid and if it turns out that we cannot find an, non-deleted, equivalent value in the loop below then we leave the `dbg.value` with incorrect information and not just undef?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98644



More information about the llvm-commits mailing list