]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix precise 0 handling in afdo_propagate_edge
authorJan Hubicka <hubicka@ucw.cz>
Fri, 26 Sep 2025 13:57:03 +0000 (15:57 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Fri, 26 Sep 2025 13:57:31 +0000 (15:57 +0200)
Currently afdo_propagate_edge will turn precise 0 to autofdo 0 because it thinks
auto-profile claims some samples has been executed in the given basic block, while
this is only a consequence of < being defined by
 0 (predise) < 0 (autofdo)

gcc/ChangeLog:

* auto-profile.cc (afdo_propagate_edge): Fix handling of precize 0
counts.

gcc/auto-profile.cc

index 7d867de5bd9d3ee287b177584ed0f37b840c276b..e71689de3086d6eb502fd163cae6a6272dd6a04d 100644 (file)
@@ -3181,6 +3181,8 @@ afdo_propagate_edge (bool is_succ, bb_set *annotated_bb)
        changed = true;
       }
     else if (is_bb_annotated (bb, *annotated_bb)
+            /* We do not want to consider 0 (afdo) > 0 (precise)  */
+            && total_known_count.nonzero_p ()
             && bb->count < total_known_count)
       {
        if (dump_file)