[PATCH] D95463: Avoid redundant or out-of-order debug value sinking in InstCombine

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 09:52:54 PST 2021


jmorse accepted this revision.
jmorse added a comment.
This revision is now accepted and ready to land.

LGTM, but pls2leave it 24 hours or so in case @rnk chimes in.



================
Comment at: llvm/test/Transforms/InstCombine/debuginfo-sink.ll:74-75
+sink1:
+; CHECK-LABEL: sink1:
+; CHECK:       call void @llvm.dbg.value(metadata i32* %gep,
+; CHECK-SAME:  metadata !{{[0-9]+}}, metadata !DIExpression(DW_OP_plus_uconst, 5))
----------------
StephenTozer wrote:
> jmorse wrote:
> > Doesn't this need a `CHECK-NOT dbg.value` in there, to verify that only one dbg.value is sunk?
> I don't think so - this line should match either of the debug values, and the next lines are `CHECK-SAME` and `CHECK-NEXT`. As all the sunk debug values are in a single contiguous block, this should match iff there is only one debug value sunk.
Fiddling with inputs, I couldn't get it to not fail. I think what I wanted was a much plainer "There are no dbg.values between the start of the block and the one we're matching". It looks like by having the first CHECK test for %gep, this ensures that there's only one dbg.value for %gep, which is good enough.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95463



More information about the llvm-commits mailing list