]> granicus.if.org Git - llvm/commit
[PGO] Fix select instruction annotation
authorRong Xu <xur@google.com>
Tue, 25 Oct 2016 21:47:24 +0000 (21:47 +0000)
committerRong Xu <xur@google.com>
Tue, 25 Oct 2016 21:47:24 +0000 (21:47 +0000)
commit0eba98aa7d65212850b2ec498d2f13ef8fa1e0f5
tree1f098aa6c33f11037228d0a37cd8e8c6259ca17d
parent908c768e1cbf2f35b7bcc05fa8b66caa762a69a9
[PGO] Fix select instruction annotation

Summary:
Select instruction annotation in IR PGO uses the edge count to infer the
branch count. It's currently placed in setInstrumentedCounts() where
no all the BB counts have been computed. This leads to wrong branch weights.
Move the annotation after all BB counts are populated.

Reviewers: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285128 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/PGOInstrumentation.cpp
test/Transforms/PGOProfile/Inputs/select2.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/select2.ll [new file with mode: 0644]