https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110899
--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Seems to be most of this should not implemented this way but rather an IPA RA pass (which GCC already does but not always and definitely not across IPA boundaries).