[PATCH] D80264: [Instruction] Set metadata uses to undef on deletion

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 21 14:39:00 PDT 2020


vsk added a comment.

In D80264#2048165 <https://reviews.llvm.org/D80264#2048165>, @efriedma wrote:

> Do you care to distinguish "the value was optimized out at this location", vs. "the value is uninitialized/poison at this location"?


There are different representations for optimized-out vs. uninitialized source variables at the IR level, but this patch doesn't change the status quo.

IIUC there are two ways llvm represents uninitialized source variables at the IR level: 1) with a dbg.declare that points to an uninitialized alloca, or 2) by omission, e.g. by emitting a fragment dbg.value description of a variable that doesn't cover all its bits. By contrast, optimized-out variables should always be described as 'undef' (that's what this patch is trying to do).

I haven't really thought about the interaction of poison values with debug intrinsics at all. A vague notion I have is that poison can lead to DCE: if that's so, with this patch in place, there may be instances of "poisoned" variables appearing as <unavailable> in debug sessions, instead of appearing as misleading values.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80264





More information about the llvm-commits mailing list