[ICP] Migrate to OptimizationRemarkEmitter
authorAdam Nemet <anemet@apple.com>
Thu, 27 Jul 2017 16:54:15 +0000 (16:54 +0000)
committerAdam Nemet <anemet@apple.com>
Thu, 27 Jul 2017 16:54:15 +0000 (16:54 +0000)
commit0d8b5d6f6997066cd243a06f0a7181de966c8cef
treec9aa0c3d4d6fb063ab3fdd0d86d31e6dffdd7de1
parent6374331a8c55353e5a08f757176c8cca30dabafa
[ICP] Migrate to OptimizationRemarkEmitter

This is a module pass so for the old PM, we can't use ORE, the function
analysis pass.  Instead ORE is created on the fly.

A few notes:

- isPromotionLegal is folded in the caller since we want to emit the Function
in the remark but we can only do that if the symbol table look-up succeeded.

- There was good test coverage for remarks in this pass.

- promoteIndirectCall uses ORE conditionally since it's also used from
SampleProfile which does not use ORE yet.

Fixes PR33792.

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

llvm-svn: 309294
llvm/include/llvm/Transforms/Instrumentation.h
llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
llvm/test/Other/new-pm-lto-defaults.ll
llvm/test/Other/new-pm-thinlto-defaults.ll
llvm/test/Transforms/PGOProfile/icp_mismatch_msg.ll