[PGO] Don't set the function hotness attribute when populating counters
authorRong Xu <xur@google.com>
Mon, 28 Mar 2016 17:08:56 +0000 (17:08 +0000)
committerRong Xu <xur@google.com>
Mon, 28 Mar 2016 17:08:56 +0000 (17:08 +0000)
commit6090afd7447997bd6960c0ca60931671b02a6f44
tree3c68049f29e8e57d45eaeb516a1e8993d09f15c1
parentad154c837e4428842cfe5c0f9dbfcc42ba7a1454
[PGO] Don't set the function hotness attribute when populating counters

Don't set the function hotness attribute on the fly. This changes the CFG
branch probability of the caller function, which leads to inconsistent BB
ordering. This patch moves the attribute setting to a separated loop after
 the counts in all functions are populated.

Fixes PR27024 - PGO instrumentation profile data is not reflected in correct
basic blocks.

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

llvm-svn: 264594
llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp