diff options
author | Richard Biener <rguenther@suse.de> | 2025-01-07 13:18:27 +0100 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2025-01-07 15:33:58 +0100 |
commit | 34501ef418da13b361614235077c2162caabab73 (patch) | |
tree | d30921558ae39f56d442508139d9d5e9b55321f2 | |
parent | cda313ba6215d20150db6e952ce62138e9127d21 (diff) | |
download | gcc-34501ef418da13b361614235077c2162caabab73.zip gcc-34501ef418da13b361614235077c2162caabab73.tar.gz gcc-34501ef418da13b361614235077c2162caabab73.tar.bz2 |
rtl-optimization/118298 - constant iteration loops and #pragma unroll
When the RTL unroller handles constant iteration loops it bails out
prematurely when heuristics wouldn't apply any unrolling before
checking #pragma unroll.
PR rtl-optimization/118298
* loop-unroll.cc (decide_unroll_constant_iterations): Honor
loop->unroll even if the loop is too big for heuristics.
-rw-r--r-- | gcc/loop-unroll.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/loop-unroll.cc b/gcc/loop-unroll.cc index 2bd6e88..b495205 100644 --- a/gcc/loop-unroll.cc +++ b/gcc/loop-unroll.cc @@ -372,7 +372,8 @@ decide_unroll_constant_iterations (class loop *loop, int flags) nunroll = targetm.loop_unroll_adjust (nunroll, loop); /* Skip big loops. */ - if (nunroll <= 1) + if (nunroll <= 1 + && !(loop->unroll > 1 && loop->unroll < USHRT_MAX)) { if (dump_file) fprintf (dump_file, ";; Not considering loop, is too big\n"); |