Tune the weight propagation algorithm for sample profile.
authorDehao Chen <dehao@google.com>
Mon, 11 Jul 2016 16:40:17 +0000 (16:40 +0000)
committerDehao Chen <dehao@google.com>
Mon, 11 Jul 2016 16:40:17 +0000 (16:40 +0000)
commit29d2641f52fc1410845e874b829b7c039e01c50e
treeb51ac17753d13ce6484ca121f4abadbb19346faf
parentddc3cc65cb16b3f655782d29f9fccb7488f826ec
Tune the weight propagation algorithm for sample profile.

Summary: Handle the case when there is only one incoming/outgoing edge for a visited basic block: use the block weight to adjust edge weight even when the edge has been visited before. This can help reduce inaccuracies introduced by incorrect basic block profile, as shown in the updated unittest.

Reviewers: davidxl, dnovillo

Subscribers: llvm-commits

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

llvm-svn: 275072
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/Transforms/SampleProfile/fnptr.ll