[PATCH] D97734: [Remarks] Emit variable info in auto-init remarks

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 14:01:06 PST 2021


thegameg created this revision.
thegameg added reviewers: fhahn, paquette.
Herald added subscribers: jfb, hiraditya.
thegameg requested review of this revision.
Herald added a project: LLVM.

This enhances the auto-init remark with information about the variable
that is auto-initialized.

This is based of debug info if available, or alloca names (mostly for
development purposes).

  auto-init.c:4:7: remark: Call to memset inserted by -ftrivial-auto-var-init. Memory operation size: 4096 bytes.Variables: var (4096 bytes). [-Rpass-missed=annotation-remarks]
    int var[1024];
        ^

This allows to see things like partial initialization of a variable that
the optimizer won't be able to completely remove.


https://reviews.llvm.org/D97734

Files:
  llvm/include/llvm/Transforms/Utils/AutoInitRemark.h
  llvm/lib/Transforms/Utils/AutoInitRemark.cpp
  llvm/test/Transforms/Util/trivial-auto-var-init-call.ll
  llvm/test/Transforms/Util/trivial-auto-var-init-store.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97734.327257.patch
Type: text/x-patch
Size: 21908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210301/24e07dbd/attachment.bin>


More information about the llvm-commits mailing list