[PATCH] D52125: X86, AArch64, ARM: Do not attach debug location to spill/reload instructions

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 1 12:26:11 PDT 2018


vsk added a comment.

In https://reviews.llvm.org/D52125#1251473, @MatzeB wrote:

> In https://reviews.llvm.org/D52125#1235612, @vsk wrote:
>
> > As Matthias points out, a spill/reload can't unambiguously be associated with a specific instruction.
> >
> > Note that passing an empty location means that the instruction is described by the previous .loc directive in the stream (if one is present). I think the pedantic thing to do would be to use the special "line 0" location. However, that might bloat the line table and possibly interfere with the way llvm currently identifies prologues.
>
>
> What would be the difference between a "line 0" location and an empty location? They both sound like "doesn't have a corresponding location in the source" to me...


A "line 0" location is used to describe compiler-generated instructions which nonetheless have meaningful lexical scopes and inlining data. E.g you could attach "line 0" to a conditional move instruction.

An empty location isn't a location at all, so it doesn't have a specific definition. LLVM generally handles instructions without debug locations by presuming that the "last seen" location is unchanged.

>> I think this is the right approach. LGTM, although a regression test on the ARM side wouldn't hurt :).
> 
> added an aarch64 test.


Repository:
  rL LLVM

https://reviews.llvm.org/D52125





More information about the llvm-commits mailing list