]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-loop-prefetch.cc: Honour -fno-unroll-loops
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Wed, 8 May 2024 08:48:45 +0000 (10:48 +0200)
committerStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Wed, 8 May 2024 08:48:45 +0000 (10:48 +0200)
This fixes a couple of tests (gcc.dg/vect/pr109011-*.c) on s390 where
loops are unrolled although -fno-unroll-loops is specified.

gcc/ChangeLog:

* tree-ssa-loop-prefetch.cc (determine_unroll_factor): Honour
-fno-unroll-loops.

gcc/tree-ssa-loop-prefetch.cc

index 70073cc4fe46e136bc6d449b8584da9e0b4e245b..bb5d5dec77952b6d12b94af6011cc4527b75277d 100644 (file)
@@ -1401,6 +1401,10 @@ determine_unroll_factor (class loop *loop, struct mem_ref_group *refs,
   struct mem_ref_group *agp;
   struct mem_ref *ref;
 
+  /* Bail out early in case we must not unroll loops.  */
+  if (!flag_unroll_loops)
+    return 1;
+
   /* First check whether the loop is not too large to unroll.  We ignore
      PARAM_MAX_UNROLL_TIMES, because for small loops, it prevented us
      from unrolling them enough to make exactly one cache line covered by each