[PATCH] D107016: [DebugInfo][LoopStrengthReduction] Ensure restoration of cached DIExpression when using SCEV-based salvaging

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 10 01:58:29 PDT 2021


Orlando added a comment.

In D107016#2925136 <https://reviews.llvm.org/D107016#2925136>, @chrisjackson wrote:

> In D107016#2912731 <https://reviews.llvm.org/D107016#2912731>, @djtodoro wrote:
>
>> should we add a test case?
>
> I believe this is already covered somewhat by /test/Transforms/LoopStrengthReduce/dbg-preserve-2.ll.

Does that test fail without this patch and pass with it applied? If that is the case, and you don't feel that a separate test is necessary, please can you add a comment explaining that it checks for the failure that this patch addresses too?

Here's the current comment in llvm/llvm-project/blame/main/llvm/test/Transforms/LoopStrengthReduce/dbg-preserve-2.ll for reference:

  ; Test that LSR does not produce invalid debug info when a debug value is
  ; salvaged during LSR by adding additional location operands, then becomes
  ; undef, and finally recovered by SCEV salvaging.



================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:6190
+      // LSR may have updated the expression, so restore to the expression
+      // that corresponds to te cached SCEV.
+      DVIRec.DVI->setExpression(DVIRec.Expr);
----------------



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

https://reviews.llvm.org/D107016



More information about the llvm-commits mailing list