OSDN Git Service

[LTO] Support Statistics
authorAdam Nemet <anemet@apple.com>
Tue, 16 Feb 2016 21:41:51 +0000 (21:41 +0000)
committerAdam Nemet <anemet@apple.com>
Tue, 16 Feb 2016 21:41:51 +0000 (21:41 +0000)
commit6df4a6f175f55af8febc1885675dfc6dd0af91ab
treebe56c54e87b852b4fde42b377e173f106a943b92
parent78eacd7a04984ccc0ca8939a227ae3fafb77b7df
[LTO] Support Statistics

Summary:
I thought -Xlinker -mllvm -Xlinker -stats worked at some point but maybe
it never did.

For clang, I believe that stats are printed from cc1_main.  This patch
also prints them for LTO, specifically right after codegen happens.

I only looked at the C API for LTO briefly to see if this is a good
place.  Probably there are still cases where this wouldn't be printed
but it seems to be working for the common case.  I also experimented
putting this in the LTOCodeGenerator destructor but that didn't trigger
for me because ld64 does not destroy the LTOCodeGenerator.

Reviewers: dexonsmith, joker.eph

Subscribers: rafael, joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261013 91177308-0d34-0410-b5e6-96231b3b80d8
lib/LTO/LTOCodeGenerator.cpp
test/tools/lto/print-stats.ll [new file with mode: 0644]