Add pass to add !annotate metadata from @llvm.global.annotations.
authorFlorian Hahn <flo@fhahn.com>
Mon, 16 Nov 2020 09:49:04 +0000 (09:49 +0000)
committerFlorian Hahn <flo@fhahn.com>
Mon, 16 Nov 2020 14:57:11 +0000 (14:57 +0000)
commit8dbe44cb2936ecafea4b26ef16d1727371ad203f
tree3e3c7c8d9828a0bfa1fb0e1dce97d9b423680349
parent47fd19f22eb5e6a7e711ca44f0414e2de7614f4b
Add pass to add !annotate metadata from @llvm.global.annotations.

This patch adds a new pass to add !annotation metadata for entries in
@llvm.global.anotations, which is generated  using
__attribute__((annotate("_name"))) on functions in Clang.

This has been discussed on llvm-dev as part of
    RFC: Combining Annotation Metadata and Remarks
    http://lists.llvm.org/pipermail/llvm-dev/2020-November/146393.html

Reviewed By: thegameg

Differential Revision: https://reviews.llvm.org/D91195
25 files changed:
clang/test/CodeGen/code-coverage.c
llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/Transforms/IPO.h
llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h [new file with mode: 0644]
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Passes/PassRegistry.def
llvm/lib/Transforms/IPO/Annotation2Metadata.cpp [new file with mode: 0644]
llvm/lib/Transforms/IPO/CMakeLists.txt
llvm/lib/Transforms/IPO/IPO.cpp
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
llvm/test/CodeGen/AMDGPU/opt-pipeline.ll
llvm/test/Other/new-pm-defaults.ll
llvm/test/Other/new-pm-lto-defaults.ll
llvm/test/Other/new-pm-thinlto-defaults.ll
llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll
llvm/test/Other/opt-O0-pipeline.ll
llvm/test/Other/opt-O2-pipeline.ll
llvm/test/Other/opt-O3-pipeline-enable-matrix.ll
llvm/test/Other/opt-O3-pipeline.ll
llvm/test/Other/opt-Os-pipeline.ll
llvm/test/Transforms/Util/annotation2metadata.ll [new file with mode: 0644]