Skip to content
Snippets Groups Projects
Commit 3d9e6767 authored by Eugene Rozenfeld's avatar Eugene Rozenfeld
Browse files

Improve AutoFDO count propagation algorithm

When a basic block A has been annotated with a count and it has only one
successor (or predecessor) B, we can propagate the A's count to B.
The algoritm without this change could leave B without an annotation if B had
other unannotated predecessors (or successors). For example, in the test case I added,
the loop header block was left unannotated, which prevented loop unrolling.

gcc/ChangeLog:
	* auto-profile.c (afdo_propagate_edge): Improve count propagation algorithm.

gcc/testsuite/ChangeLog:
	* gcc.dg/tree-prof/init-array.c: New test for unrolling inner loops.
parent 3a580f96
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment