]> granicus.if.org Git - llvm/commit
Do not set branch weight if the branch weight annotation is present.
authorDehao Chen <dehao@google.com>
Thu, 23 Mar 2017 14:43:10 +0000 (14:43 +0000)
committerDehao Chen <dehao@google.com>
Thu, 23 Mar 2017 14:43:10 +0000 (14:43 +0000)
commitb9056a6799783cb8ebe29311d4780c5e06c1366e
treee7a348767ec610f1cdae6dee43fb0d9549dc9cfe
parent416795ac4c891100f77e978e2e1f3d8686fa788f
Do not set branch weight if the branch weight annotation is present.

Summary: ThinLTO will annotate the CFG twice. If the branch weight is set by the first annotation, we should not set the branch weight again in the second annotation because the first annotation is more accurate as there is less optimization that could affect debug info accuracy.

Reviewers: tejohnson, davidxl

Reviewed By: tejohnson

Subscribers: mehdi_amini, aprantl, llvm-commits

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

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