https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119900
--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Sadly this did not fix the whole regression. The problem is that after my change to enable ipa-cp to clone over cold edges we clone GetVirtualPixelsFromNexus twice (as constprop.0 and constprop.1). This function calls SetPixelCacheNexusPixels.isra.0 which needs to be inlined to get good performance. Now the problem is that cutoff for hot code is: 9358048944: time:2 (6.38) size:2 (0.00) 9312701352: time:29 (98.38) size:29 (0.01) 46090224: time:2 (98.41) size:2 (0.01) 45347592: time:5 (98.49) size:5 (0.01) 23936592: time:2 (98.51) size:2 (0.01) 23847888: time:20 (98.67) size:19 (0.02) 23846892: time:10 (98.75) size:10 (0.03) 23844228: time:14 (98.86) size:14 (0.03) 23842804: time:50 (99.27) size:40 (0.04) <--- here is the cutoff 23842652: time:3 (99.29) size:3 (0.05) 23842500: time:2 (99.31) size:2 (0.05) 23841808: time:11 (99.40) size:11 (0.05) 23838196: time:8 (99.46) size:8 (0.05) 23739800: time:48 (99.85) size:57 (0.07) 11968296: time:2 (99.86) size:2 (0.07) 11869900: time:3 (99.87) size:3 (0.08) 3132000: time:2 (99.87) size:2 (0.08) 2503800: time:33 (99.90) size:33 (0.09) 1338020: time:2 (99.90) size:2 (0.09) 1069820: time:35 (99.92) size:35 (0.10) Determined min count: 23842804 Time:99.27% Size:0.04% So there is actual code with counters very close to the cutoff and that is the case of the call in question which is called 23847888 times. Now cloning twise reduces count of each call to 8367864 (for constprop.0), 15459299 (for constrprop.1) and 15641 (for the non-cloned version) which are all bellow threshold so we no longer inline. This is likely non-representative train run. Inliner can scale the count by speedup before deciding on hotness which would likely make this inlining happen. Problem is that the computation is on a hot path and I am not sure I want to slow it down for this, since those are cases that should be theoretically caught by ipa-cp. --param hot-bb-count-ws-permille=999 Improves rate from 13.0 to 14.2 (9%).