summaryrefslogtreecommitdiff
path: root/gcc/loop-unroll.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-11-27 11:56:36 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-11-27 11:56:36 +0000
commitff27462edc398ca82e86c8c7f13d9fab498ba5c1 (patch)
tree08222828f4dd3f24e1e5561f204474cdf8789d12 /gcc/loop-unroll.c
parent39335d1486c5f39182bd0cca6af52a49386319cb (diff)
cfgloop.h (struct loop): Document usage of USHRT_MAX for unroll.
* cfgloop.h (struct loop): Document usage of USHRT_MAX for unroll. * loop-unroll.c (decide_unroll_constant_iterations): Implement it. (decide_unroll_runtime_iterations): Likewise. (decide_unroll_stupid): Likewise. From-SVN: r255165
Diffstat (limited to 'gcc/loop-unroll.c')
-rw-r--r--gcc/loop-unroll.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index bbba35fbff1..0fdecd7fde2 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -395,7 +395,7 @@ decide_unroll_constant_iterations (struct loop *loop, int flags)
}
/* Check for an explicit unrolling factor. */
- if (loop->unroll)
+ if (loop->unroll > 0 && loop->unroll < USHRT_MAX)
{
/* However we cannot unroll completely at the RTL level a loop with
constant number of iterations; it should have been peeled instead. */
@@ -693,7 +693,7 @@ decide_unroll_runtime_iterations (struct loop *loop, int flags)
if (targetm.loop_unroll_adjust)
nunroll = targetm.loop_unroll_adjust (nunroll, loop);
- if (loop->unroll)
+ if (loop->unroll > 0 && loop->unroll < USHRT_MAX)
nunroll = loop->unroll;
/* Skip big loops. */
@@ -1177,7 +1177,7 @@ decide_unroll_stupid (struct loop *loop, int flags)
if (targetm.loop_unroll_adjust)
nunroll = targetm.loop_unroll_adjust (nunroll, loop);
- if (loop->unroll)
+ if (loop->unroll > 0 && loop->unroll < USHRT_MAX)
nunroll = loop->unroll;
/* Skip big loops. */