Subject: Limit inline block move loop expansion to 256 bytes on MIPS Author: Evgeny Lapik Prevent GCC from generating bloated and unoptimized inline assembly loops for large memcpy operations. Instead of inlining loops for blocks larger than 256 bytes, force a library call to the highly optimized libc memcpy, which utilizes hardware-specific features like prefetching and cache alignment. --- a/src/gcc/config/mips/mips.cc +++ b/src/gcc/config/mips/mips.cc @@ -8317,7 +8317,7 @@ mips_block_move_straight (dest, src, INTVAL (length)); return true; } - else if (optimize) + else if (optimize && (INTVAL (length) <= 256)) { mips_block_move_loop (dest, src, INTVAL (length), MIPS_MAX_MOVE_BYTES_PER_LOOP_ITER);