[all-commits] [llvm/llvm-project] 365b78: [Remarks] Emit variable info in auto-init remarks

Visoiu Mistrih Francis via All-commits all-commits at lists.llvm.org
Thu Mar 4 12:51:48 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 365b78396abf18a1d9be7962c0831ea61b3f4dc1
      https://github.com/llvm/llvm-project/commit/365b78396abf18a1d9be7962c0831ea61b3f4dc1
  Author: Francis Visoiu Mistrih <francisvm at yahoo.com>
  Date:   2021-03-04 (Thu, 04 Mar 2021)

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

  Log Message:
  -----------
  [Remarks] Emit variable info in auto-init remarks

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.

Differential Revision: https://reviews.llvm.org/D97734




More information about the All-commits mailing list