[PATCH] D91417: [IRGen] Add !annotation metadata for auto-init stores.

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 13 05:34:19 PST 2020


fhahn created this revision.
fhahn added reviewers: thegameg, paquette, jdoerfert, rjmccall.
Herald added subscribers: cfe-commits, dexonsmith, jfb, hiraditya.
Herald added projects: clang, LLVM.
fhahn requested review of this revision.

This patch updates Clang's IRGen to add !annotation nodes with an
"auto-init" annotation to all stores for auto-initialization.

As discussed in 'RFC: Combining Annotation Metadata and Remarks'
(http://lists.llvm.org/pipermail/llvm-dev/2020-November/146393.html)
this allows using optimization remarks to track down where auto-init
code was inserted (and not removed by optimizations).

There are a few cases in the tests where !annotation gets dropped by
optimizations. Those optimizations will be updated in subsequent
patches.

This patch is based on a patch by Francis Visoiu Mistrih.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91417

Files:
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/CodeGen/CGDecl.cpp
  clang/test/CodeGenCXX/auto-var-init.cpp
  clang/test/CodeGenCXX/trivial-auto-var-init-attribute.cpp
  clang/test/CodeGenCXX/trivial-auto-var-init.cpp
  llvm/include/llvm/IR/Instruction.h
  llvm/lib/IR/Metadata.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91417.305110.patch
Type: text/x-patch
Size: 105542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201113/8eff89c7/attachment-0001.bin>


More information about the cfe-commits mailing list