Add function entry count metadata.
authorDiego Novillo <dnovillo@google.com>
Wed, 13 May 2015 15:13:45 +0000 (15:13 +0000)
committerDiego Novillo <dnovillo@google.com>
Wed, 13 May 2015 15:13:45 +0000 (15:13 +0000)
commita3bccceda7ca4d8e8fe8541675b594b4b7ba4148
tree4b488412cdbfe7573f1c762447a1f08c38bd94e5
parentdcc57103b82525a35a9e7acc0109d20a83b2b0a0
Add function entry count metadata.

Summary:
This adds three Function methods to handle function entry counts:
setEntryCount() and getEntryCount().

Entry counts are stored under the MD_prof metadata node with the name
"function_entry_count". They are unsigned 64 bit values set by profilers
(instrumentation and sample profiler changes coming up).

Added documentation for new profile metadata and tests.

Reviewers: dexonsmith, bogner

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9628

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237260 91177308-0d34-0410-b5e6-96231b3b80d8
docs/BranchWeightMetadata.rst
include/llvm/IR/Function.h
include/llvm/IR/MDBuilder.h
lib/IR/Function.cpp
lib/IR/MDBuilder.cpp
lib/IR/Verifier.cpp
test/Verifier/function-metadata-bad.ll [new file with mode: 0644]
test/Verifier/function-metadata-good.ll [new file with mode: 0644]
unittests/IR/MetadataTest.cpp