[SampleProfile] Repeat indirect call promotion only when the target is actually hot.
authorTaewook Oh <twoh@fb.com>
Tue, 2 Apr 2019 15:48:21 +0000 (15:48 +0000)
committerTaewook Oh <twoh@fb.com>
Tue, 2 Apr 2019 15:48:21 +0000 (15:48 +0000)
commit6a27c48be223ce25b73eab7a49f4d502cdf24dce
tree5b6780d9b5069db5ffdf9839417c041f33f5d38b
parentb69afa8e9ba51c2e136a9abc3222b8ec40cd128a
[SampleProfile] Repeat indirect call promotion only when the target is actually hot.

Summary: It is possible that multiple indirect call targets have been promoted for a single callsite from the profiled binary. Current implementation repeats promotion for all these targets as far as the callsite itself is hot (the callsite is assumed to be hot if any one of these targets was "hot" during the profiling). However, even when one of the ICPed target is hot other targets may not, and we should not repeat promotion for "cold" targets.

Reviewers: danielcdh, wmi

Subscribers: hiraditya, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 357484
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/Transforms/SampleProfile/Inputs/cold-indirect-call.prof [new file with mode: 0644]
llvm/test/Transforms/SampleProfile/cold-indirect-call.ll [new file with mode: 0644]