[PATCH] D91722: [DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands
Stephen Tozer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 3 06:17:45 PST 2020
StephenTozer added inline comments.
================
Comment at: llvm/test/Transforms/Reassociate/undef_intrinsics_when_deleting_instructions.ll:6
-define hidden i32 @main() local_unnamed_addr {
+; CHECK-NOT: %add = fadd fast float %a, %b
+; CHECK: call void @llvm.dbg.value(metadata float undef, metadata [[VAR_X:![0-9]+]], metadata !DIExpression())
----------------
dblaikie wrote:
> StephenTozer wrote:
> > A note for reviewers on the changes made to this test: this test has been modified to prevent it failing after this patch is applied. The failure introduced by this patch is not an error, but the opposite: the test relies on intrinsics being made undef when the instruction they relied on is deleted, but as of this patch we are able to salvage them so they will not be set undef. In order to preserve the spirit of this test, I changed it to instead reassociate float arithmetic instructions, which cannot currently be salvaged and so results in the intrinsic being undef'd like before.
> Any chance of using something that'd be even more robust by using, for instance, a call to an external 'pure' function where the return value is used to define the debug value, but is otherwise unused - there would the instruction could be deleted but there would be no way the value could be reconstituted no matter how much we improve debug info in the future
In a more general case I'd say so, but this behaviour in the reassociate pass is stimulated by arithmetic instructions, rather than just dead code in general; making use of float arithmetic in this case seemed to be the shortest path.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91722/new/
https://reviews.llvm.org/D91722
More information about the llvm-commits
mailing list