1 /* { dg-require-effective-target vect_float } */
8 __attribute__ ((noinline
))
9 void bar (float *pa
, float *pb
, float *pc
)
14 for (i
= 0; i
< N
; i
++)
16 if (pa
[i
] != (pb
[i
] * pc
[i
]))
24 __attribute__ ((noinline
)) int
25 main1 (float *pa
, float *pb
, float *pc
)
28 float b
[N
] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__
)));
29 float c
[N
] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__
)));
31 for (i
= 0; i
< N
; i
++)
37 /* Vectorizable: pa may not alias pb and/or pc, even though their
38 addresses escape. &pa would need to escape to point to escaped memory. */
39 for (i
= 0; i
< N
; i
++)
49 __attribute__ ((noinline
)) int
50 main2 (float *pa
, float *pb
, float *pc
)
53 float b
[N
] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__
)));
54 float c
[N
] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__
)));
56 for (i
= 0; i
< N
; i
++)
62 /* Vectorizable: pb and pc addresses do not escape. */
63 for (i
= 0; i
< N
; i
++)
69 for (i
= 0; i
< N
; i
++)
71 if (pa
[i
] != (b
[i
] * c
[i
]))
81 float a
[N
] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__
)));
82 float b
[N
] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
83 float c
[N
] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
92 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 2 "vect" } } */
93 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */