https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107006

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to H. Peter Anvin from comment #11)
> If you look at the output, you see that the loops are already fully unrolled
> (at considerable code size cost.)

The unrolling is done too late for the bswap detection pass to trigger.

> Unfortunately, since the issue at hand is dealing with code written to be
> portable, adding gcc-specific hacks are not really a reasonable option.

Well, #pragma GCC unroll n is "portable" in that #pragma is an ISO C feature
and pragmas in the 'GCC' domain are supposed to be ignored by other compilers,
so not sure what you are wanting to say here.

You can also manually unroll of course.

Alternatively somebody can try to implement loop pattern matching for
bswap/load.  It's a reduction so blueprints might be available by the
strlen pattern matching in loop_distribution::transform_reduction_loop.

Reply via email to