[PATCH] D55372: [DebugInfo] Emit "undef" DBG_VALUEs when SDNodes are optimised out

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 7 08:38:28 PST 2018


aprantl accepted this revision.
aprantl added inline comments.
This revision is now accepted and ready to land.


================
Comment at: test/DebugInfo/X86/pieces-3.ll:40
   %outer.sroa.1.8.extract.trunc = trunc i64 %outer.coerce1 to i32, !dbg !33
   call void @llvm.dbg.value(metadata i32 %outer.sroa.1.8.extract.trunc, metadata !34, metadata !35), !dbg !33
   ret i32 %outer.sroa.1.8.extract.trunc, !dbg !36
----------------
jmorse wrote:
> aprantl wrote:
> > Why is this necessary?
> IMHO lines 41-45 are wrong. On line 40 we dbg.value assign the (truncated) return value to the 0-32 fragment of "i1", rotate and truncate %outer.coerce1 to get the other part of "i1" on line 42, then on lines 43-45 we dbg.value assign it to the same 0-32 fragment of "i1". The lower field of "i1" thus gets two dbg.value assignments where the original C program had only one. The second refers to values that SelectionDAG drops -- previously this was ignored, but now it un-necessarily shortens the range of the first assignment.
> 
> Originally I just deleted this block of code because it seemed invalid (and clang doesn't generate it any more). Prodding further, a better solution might be pointing the lines 43-44 dbg.values at the fragment of i1 that they truly correspond to, I'll upload a revised patch that does this.
Totally possible that this is bitrotted or was never correct to begin with. Thanks for explaining!


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

https://reviews.llvm.org/D55372





More information about the llvm-commits mailing list