[all-commits] [llvm/llvm-project] 324af7: [GlobalISel] Don't emit lost debug location remark...

Jessica Paquette via All-commits all-commits at lists.llvm.org
Wed May 26 17:16:34 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 324af79dbc606678c4067411aca2a4ff2af831d7
      https://github.com/llvm/llvm-project/commit/324af79dbc606678c4067411aca2a4ff2af831d7
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2021-05-26 (Wed, 26 May 2021)

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

  Log Message:
  -----------
  [GlobalISel] Don't emit lost debug location remarks when legalizing tail calls

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.

Differential Revision: https://reviews.llvm.org/D103128




More information about the All-commits mailing list