[PATCH] D91722: [DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 16:40:57 PST 2020


dblaikie added a comment.

(minor drive-by comment, but I'm not the right person to do more in depth review of this patch, unfortunately)



================
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())
----------------
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


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