[llvm-dev] Preserving debug metadata across optimization

Jan Vesely via llvm-dev llvm-dev at lists.llvm.org
Wed Feb 20 20:07:09 PST 2019


I've recently run into a problem of missing !dbg metadata after the
code has been optimized (even opt -O1).
The original code was generated using llvmlite python package and I've
verified that all instructions have their !dbg metadata present.
After optimizing the module (even opt -O1) I see that some
instructions (~25%) don't have any dbg metadata.
These are mostly getelementptr and bitcasts, but there's also few
One example:
  %.510.i.i = bitcast [2 x double]* %.4 to i8*
  tail call void @llvm.memset.p0i8.i64(i8* nonnull align 8 %.510.i.i, i8 0, i64 16, i1 false) #5, !dbg !2822, !alias.scope !2825, !noalias !2830

There are no memset calls in the original code. the introduced bitcast is lacking the location metadata.
The behaviour persists across llvm-6/7/git.
Is it just a series of bugs that I'm hitting?

Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190220/74bfd930/attachment.sig>

More information about the llvm-dev mailing list