[PATCH] D102917: [LiveDebugVariables] Stop trimming locations of non-inlined vars

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 24 03:31:36 PDT 2021


jmorse added a comment.

This makes sense to me: the range extension mechanism puts in DBG_VALUEs at points where the live value switches from one register to another, something that LiveDebugValues can't know later on, and often gets wrong. Instruction spans with the "wrong" scope in the middle of a block will prematurely terminate ranges -- or in the case of the prologue, it won't cover early instructions. I think there's also potential for an argument that's moved more than once in the prologue to be dropped, not completely certain.

Either way: it's my understanding that the range trimming is about avoiding excessive compile time costs. There's no functional reason why we shouldn't extend all ranges over the whole program, it just happens to create pathological behaviour  in certain circumstances, particularly when there's heavy inlining. IMO, making this conditional on a variable not being inlined is a good trade-off, we produce as much information as possible for the small number of "top level" variables, and less for everything that's inlined.

(One comment inline).



================
Comment at: llvm/lib/CodeGen/LiveDebugVariables.cpp:1172
       // may be further trimmed).
       if (RStart < IStop)
         I.insert(RStart, IStop, DbgValue);
----------------
Does this range-check need to be guarded by getInlinedAt() too?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102917



More information about the llvm-commits mailing list