[PATCH] D103128: [GlobalISel] Don't emit lost debug location remarks when legalizing tail calls

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 25 17:15:23 PDT 2021


paquette created this revision.
paquette added reviewers: aemerson, arsenm.
Herald added subscribers: hiraditya, kristof.beyls, rovka.
paquette requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

There were a bunch of lost debug location remarks that show up when legalizing tail calls on AArch64.

This would happen because we drop the return in the block where we emit the tail call. So, we end up dropping the debug location, which makes the `LostDebugLocObserver` report a missing debug location.

Although it's *true* that we lose these debug locations, this isn't a particularly useful remark. We expect to drop these debug locations when emitting tail calls. Suppressing remarks in this case is preferable, since the amount of noise could hide actual debug location related bugs.

To do this, I just plumbed the `LostDebugLocObserver` through the relevant `LegalizerHelper` functions. This is the only case I can think of where we need the `LostDebugLocObserver` in the `LegalizerHelper`. So, rather than storing it in the `LegalizerHelper` proper and mucking around with the constructors, I figured it'd be cleanest to take the simplest path for now.

This clears up ~20 noisy lost debug location remarks on CTMark in AArch64 at -Os.


https://reviews.llvm.org/D103128

Files:
  llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
  llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
  llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/debug-loc-legalize-tail-call.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103128.347828.patch
Type: text/x-patch
Size: 7295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210526/b151bb88/attachment.bin>


More information about the llvm-commits mailing list