[all-commits] [llvm/llvm-project] ca2e7e: [IRGen] Add !annotation metadata for auto-init sto...

Florian Hahn via All-commits all-commits at lists.llvm.org
Mon Nov 16 02:42:46 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ca2e7e59994d167c74f4ecfdda682d2a826124e3
      https://github.com/llvm/llvm-project/commit/ca2e7e59994d167c74f4ecfdda682d2a826124e3
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-11-16 (Mon, 16 Nov 2020)

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

  Log Message:
  -----------
  [IRGen] Add !annotation metadata for auto-init stores.

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.

Reviewed By: thegameg, paquette

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




More information about the All-commits mailing list