(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
costmodel/
ppc/
costmodel-vect-76b.c
       1  /* { dg-require-effective-target vect_int } */
       2  /* { dg-additional-options "-fno-tree-loop-distribute-patterns" } */
       3  
       4  #include <stdarg.h>
       5  #include "../../tree-vect.h"
       6  
       7  /* On Power7 without misalign vector support, this case is to check it's not
       8     profitable to perform vectorization by peeling to align the store.  */
       9  #define N 14
      10  #define OFF 4
      11  
      12  /* Check handling of accesses for which the "initial condition" -
      13     the expression that represents the first location accessed - is
      14     more involved than just an ssa_name.  */
      15  
      16  int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
      17  
      18  int main1 (int *pib)
      19  {
      20    int i;
      21    int ia[N+OFF];
      22    int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
      23  
      24    for (i = OFF; i < N; i++)
      25      {
      26        pib[i - OFF] = ic[i];
      27      }
      28  
      29  
      30    /* check results:  */
      31    for (i = OFF; i < N; i++)
      32      {
      33       if (pib[i - OFF] != ic[i])
      34          abort ();
      35      }
      36  
      37    return 0;  
      38  }
      39  
      40  int main (void)
      41  {
      42    check_vect ();
      43  
      44    main1 (&ib[OFF]);
      45    return 0;
      46  }
      47  
      48  /* Peeling to align the store is used. Overhead of peeling is too high.  */
      49  /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { vector_alignment_reachable && {! vect_no_align} } } } } */
      50  /* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
      51  
      52  /* Versioning to align the store is used. Overhead of versioning is not too high.  */
      53  /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_no_align || {! vector_alignment_reachable} } } } } */