(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
bb-slp-cond-1.c
       1  /* { dg-require-effective-target vect_condition } */
       2  /* { dg-additional-options "-fdump-tree-vect-details" } */
       3  
       4  #include "tree-vect.h"
       5  
       6  #define N 128
       7  
       8  __attribute__((noinline, noclone)) void
       9  foo (int *a, int stride)
      10  {
      11    int i;
      12  
      13    for (i = 0; i < N/stride; i++, a += stride)
      14     {
      15       a[0] = a[0] ? 1 : 5;
      16       a[1] = a[1] ? 2 : 6;
      17       a[2] = a[2] ? 3 : 7;
      18       a[3] = a[3] ? 4 : 8;
      19     }
      20  }
      21  
      22  
      23  int a[N];
      24  int main ()
      25  {
      26    int i;
      27  
      28    check_vect ();
      29  
      30    for (i = 0; i < N; i++)
      31      {
      32        a[i] = i;
      33        asm volatile ("" ::: "memory");
      34      }
      35  
      36    foo (a, 4);
      37  
      38    for (i = 1; i < N; i++)
      39      if (a[i] != i%4 + 1)
      40        abort ();
      41  
      42    if (a[0] != 5)
      43      abort ();
      44  
      45    return 0;
      46  }
      47  
      48  /* { dg-final { scan-tree-dump {(no need for alias check [^\n]* when VF is 1|no alias between [^\n]* when [^\n]* is outside \(-16, 16\))} "vect" { target vect_element_align } } } */
      49  /* { dg-final { scan-tree-dump-times "loop vectorized" 1 "vect" { target { vect_element_align && { ! amdgcn-*-* } } } } } */
      50  /* { dg-final { scan-tree-dump-times "loop vectorized" 2 "vect" { target amdgcn-*-* } } } */
      51