Do not combine PRED_LOOP_GUARD and PRED_LOOP_GUARD_WITH_RECURSION
This patch avoids both PRED_LOOP_GUARD and PRED_LOOP_GUARD_WITH_RECURSION to be
attached to one edge. We have logic that prevents same predictor to apply to
one edge twice, but since we split LOOP_GUARD to two more specialized cases,
this no longer fires.
Double prediction happens in exchange benchmark and leads to unrealistically
low hitrates on some edges which in turn leads to bad IPA profile and misguides
ipa-cp.
Unforutnately it seems that the bad profile also leads to bit better
performance by disabling some of loop stuff, but that really ought to be done
in some meaningful way, not by an accident.
gcc/ChangeLog:
2020-08-11 Jan Hubicka <hubicka@ucw.cz>
* predict.c (not_loop_guard_equal_edge_p): New function.
(maybe_predict_edge): New function.
(predict_paths_for_bb): Use it.
(predict_paths_leading_to_edge): Use it.
gcc/testsuite/ChangeLog:
2020-08-11 Jan Hubicka <hubicka@ucw.cz>
* gcc.dg/ipa/ipa-clone-2.c: Lower threshold from 500 to 400.