(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
costmodel/
ppc/
costmodel-vect-33.c
       1  /* { dg-do compile } */
       2  /* { dg-require-effective-target vect_int } */
       3  /* { dg-additional-options "-fno-tree-loop-distribute-patterns" } */
       4  
       5  #include <stdarg.h>
       6  #include "../../tree-vect.h"
       7  
       8  #define N 16
       9  struct test {
      10    char ca[N];
      11  };
      12  
      13  extern struct test s;
      14   
      15  __attribute__((noipa)) int main1 ()
      16  {  
      17    int i;
      18  
      19    for (i = 0; i < N; i++)
      20      {
      21        s.ca[i] = 5;
      22      }
      23  
      24    /* check results:  */
      25    for (i = 0; i < N; i++)
      26      {
      27        if (s.ca[i] != 5)
      28          abort ();
      29      }
      30  
      31    return 0;
      32  }
      33  
      34  int main (void)
      35  { 
      36    return main1 ();
      37  } 
      38  
      39  /* Peeling to align the store is used. Overhead of peeling is too high.  */
      40  /* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target { ! natural_alignment_32 } } } } */
      41  
      42  /* Vectorization occurs, either because overhead of versioning is not
      43     too high, or because the hardware supports efficient unaligned accesses.  */
      44  /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { natural_alignment_32 } } } } */
      45  
      46  /* Versioning to align the store is used.  Overhead of versioning is not 
      47     too high.  */
      48  /* { dg-final { scan-tree-dump-times "loop versioned for vectorization to enhance alignment" 1 "vect" { target { natural_alignment_32 && { ! vect_hw_misalign } } } } } */