]> granicus.if.org Git - llvm/commit
[PGO] Enhance pgo counter promotion
authorXinliang David Li <davidxl@google.com>
Wed, 12 Jul 2017 23:27:44 +0000 (23:27 +0000)
committerXinliang David Li <davidxl@google.com>
Wed, 12 Jul 2017 23:27:44 +0000 (23:27 +0000)
commit7bac219fe19c95b696beffc80dc93bd75524243b
treed99a749f1e86d2e92c19f202ef452c30cae9c76e
parent30f6cbbbb13a776d3f17f59149a65155ed85b8cd
[PGO] Enhance pgo counter promotion

This is an incremental change to the promotion feature.

There are two problems with the current behavior:
1) loops with multiple exiting blocks are totally disabled
2) a counter update can only be promoted one level up in
  the loop nest -- which does help much for short trip
  count inner loops inside a high trip-count outer loops.

Due to this limitation, we still saw very large profile
count fluctuations from run to run for the affected loops
which are usually very hot.

This patch adds the support for promotion counters iteratively
across the loop nest. It also turns on the promotion for
loops with multiple exiting blocks (with a limit).

For single-threaded applications, the performance impact is flat
on average. For instance, dealII improves, but povray regresses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307863 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/InstrProfiling.cpp
test/Transforms/PGOProfile/counter_promo_exit_merge.ll
test/Transforms/PGOProfile/counter_promo_mexits.ll
test/Transforms/PGOProfile/counter_promo_nest.ll [new file with mode: 0644]