https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54089
--- Comment #83 from Alexander Klepikov <klepikov.alex+bugs at gmail dot com> --- Created attachment 55367 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55367&action=edit Collapsed libcall and additional loop move invariants patch v3 I digged other targets and I found that cfun->machine can point to user-defined structure. So I implemented per-function data through it. Loop optimizer now runs when -O2 or higher is specified and only for functions where ashrsi3 libcall was expanded. I also ran all tests I did before a few times.