[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
Mon Sep 13 01:30:06 PDT 2021
Orlando added a comment.
There seems to be quite a lot of metadata in the new test so I had a look around for quick ways to reduce it. One option could be:
opt dbg-preserve-3.ll --strip-nonlinetable-debuginfo -o stripped.ll -S
Then copy over the dbg.values and requisite metadata over from the original. But that is quite a lot of busywork. `-strip-dead-debug-info` //sounds // good but it doesn't appear to work on local variables. If you can reduce it further that would be good imo, but LGTM with test.
@StephenTozer seems happy already and I'm now happy (assuming test nits fixed). That just leaves @jmorse and @djtodoro who were both asking for a test too; I'll accept this tomorrow if there are no further comments.
================
Comment at: llvm/test/Transforms/LoopStrengthReduce/dbg-preserve-3.ll:5
+; correctly, after LSR the arguments must be restorded from the cache. If the
+; DIExpression has been modified, it must be restored to ensure a oorrect
+; expression is generated;
----------------
oorrect -> correct
================
Comment at: llvm/test/Transforms/LoopStrengthReduce/dbg-preserve-3.ll:47
+ %incdec.ptr = getelementptr inbounds %class.p, %class.p* %c.03, i64 1, !dbg !104
+ ; CHECK-NOT: call void @llvm.dbg.value(metadata %class.p* %lsr.iv, metadata ![[var_c]], metadata !DIExpression(DW_OP_plus_uconst, 1, DW_OP_plus_uconst, 1, DW_OP_stack_value)),
+ ; CHECK: call void @llvm.dbg.value(metadata %class.p* %lsr.iv, metadata ![[var_c:[0-9]+]], metadata !DIExpression(DW_OP_plus_uconst, 1, DW_OP_stack_value)),
----------------
Is FileCheck happy for you to use a variable like this, before it's been initialised (`[[var_c]]`)?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107016/new/
https://reviews.llvm.org/D107016
More information about the llvm-commits
mailing list