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)
commit5d2a1a5045ce51eb3c5fe70c29e1c0d996176cfb
treea462cfa0fe88436dfd147c5019bcaf98324994d1
parent972d513a5ce836a11b6575acd9436404f4dfbb22
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

llvm-svn: 317502
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/Transforms/SampleProfile/indirect-call.ll