]> granicus.if.org Git - llvm/commit
Include already promoted counts when computing SUM for VP.
authorDehao Chen <dehao@google.com>
Mon, 6 Nov 2017 19:52:49 +0000 (19:52 +0000)
committerDehao Chen <dehao@google.com>
Mon, 6 Nov 2017 19:52:49 +0000 (19:52 +0000)
commit561a742524fc0e97f2c9aa5465b85d0e3bb9862c
tree135d6b4c2d89f2f73316e3a6cc0a41d0f6818eca
parent0ec29cbb9c94236e6376445c5241722dc72b5cbc
Include already promoted counts when computing SUM for VP.

Summary: When computing the SUM for indirect call promotion, if the callsite is already promoted in the profile, it will be promoted before ICP. In the current implementation, ICP only sees remaining counts in SUM. This may cause extra indirect call targets being promoted. This patch updates the SUM to include the counts already promoted earlier. This way we do not end up promoting too many indirect call targets.

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: llvm-commits, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317502 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/SampleProfile.cpp
test/Transforms/SampleProfile/indirect-call.ll