[PATCH] D39980: Add heuristics for irreducible loop metadata under PGO

Hiroshi Yamauchi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 14:01:39 PST 2017


yamauchi created this revision.

Add the following heuristics irreducible loop metadata:

- When an irreducible loop header is missing the loop header weight metadata, give it the minimum weight seen among other headers.
- Annotate indirectbr targets with the loop header weight metadata (as they are likely to become irreducible loop headers after indirectbr tail duplication.)

These greatly improve the accuracy of the block frequency info of the Python
interpreter loop (eg. from ~3-16x off down to ~40-55% off) and the Python
performance (eg. unpack_sequence from ~50% slower to ~8% faster than GCC) due to
better register allocation under PGO.

Also simplify some test code.


https://reviews.llvm.org/D39980

Files:
  include/llvm/Analysis/BlockFrequencyInfoImpl.h
  lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  test/Analysis/BlockFrequencyInfo/irreducible_pgo.ll
  test/Transforms/PGOProfile/irreducible.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39980.122725.patch
Type: text/x-patch
Size: 19094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171113/71502ebf/attachment.bin>


More information about the llvm-commits mailing list