[PATCH] D45637: [DebugInfo] Ignore DBG_VALUE instructions in PostRA Machine Sink

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 20 11:45:09 PDT 2018


aprantl added a comment.

In https://reviews.llvm.org/D45637#1137982, @probinson wrote:

> In https://reviews.llvm.org/D45637#1137975, @aprantl wrote:
>
> > - the optimizer should never move a debug intrinsic over another intrinsic
>
>
> Sorry, can you expand on that side of the argument?


Roughly what I had in mind is a scenario like this. My example is probably a little silly:

  if (p == NULL)
    b = 1;
  p = q;
  bar()
  
  an in optimized LLVM IR:
  
  call dbg.value(!DIVariable("p", ...), null, !DIExpression(DW_OP_constu 0))
  %b = predicated_move(%p, i32 1) // assuming such an instruction exists :-)
  %p.1 = %q
  call dbg.value(!DIVariable("p", ...), %p.1,  !DIExpression())

If we were to reorder the instruction stream so that the two intrinsics are swapped, it will look like the value of p is NULL throughout the rest of the program.


https://reviews.llvm.org/D45637





More information about the llvm-commits mailing list