(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
slp-reduc-5.c
       1  /* Disabling epilogues until we find a better way to deal with scans.  */
       2  /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
       3  /* { dg-require-effective-target vect_int } */
       4  
       5  #include <stdarg.h>
       6  #include "tree-vect.h"
       7  
       8  #define N 128 
       9  
      10  int c[N];
      11  
      12  /* Vectorization of reduction using loop-aware SLP.  */
      13  
      14  __attribute__ ((noinline))
      15  int main1 (int n, int res0, int res1)
      16  {
      17    int i;
      18    int max0 = -100, max1 = -313;
      19  
      20    for (i = 0; i < n; i++) {
      21      max1 = max1 < c[2*i+1] ? c[2*i+1] : max1;
      22      max0 = max0 < c[2*i] ? c[2*i] : max0;
      23    }
      24  
      25    /* Check results:  */
      26    if (max0 != res0
      27        || max1 != res1)
      28      abort ();
      29  
      30    return 0;
      31  }
      32  
      33  int main (void)
      34  {
      35    int i;
      36  
      37    check_vect ();
      38  
      39    for (i = 0; i < N; i++)
      40      c[i] = (i+3) * -1;
      41  
      42    c[0] = c[1] = -100;
      43    main1 (N/2, -5, -6);
      44    return 0;
      45  }
      46  
      47  /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail vect_no_int_min_max } } } */
      48  /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_int_min_max } } } */
      49  /* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 0 "vect" } } */