aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vect-version-2.c
blob: 7d3fb722f477c9a55d78f8b6e34b4adafb3617ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do compile } */
/* { dg-require-effective-target vect_double } */
/* { dg-require-effective-target vect_condition } */

void foo (double *x, double *y, int m, int n, int o, int p)
{
  for (int i = 0; i < m; ++i)
    for (int j = 0; j < n; ++j)
      for (int k = 0; k < o; ++k)
	for (int l = 0; l < k; ++l)
	  {
	    double tem = x[l] + y[l];
	    if (tem != 0.)
	      y[l] = x[l];
	    else
	      y[l] = 0.;
	  }
}

/* Vectorization using partial vectors has zero versioning_threshold with
   either usage 1 or usage 2, the cond_expr replies on the computation in
   outer loop, so it doesn't need to reuse the loop version created by if
   conversion.  */
/* { dg-final { scan-tree-dump "reusing loop version created by if conversion" "vect" {target {! vect_partial_vectors } } } } */