Skip to content
Snippets Groups Projects
  • Eugene Rozenfeld's avatar
    3d9e6767
    Improve AutoFDO count propagation algorithm · 3d9e6767
    Eugene Rozenfeld authored
    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.
    3d9e6767
    History
    Improve AutoFDO count propagation algorithm
    Eugene Rozenfeld authored
    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.