111
|
1 /* { dg-do compile } */
|
|
2 /* { dg-require-effective-target vect_int } */
|
|
3 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0" } */
|
|
4
|
|
5 #include <stdarg.h>
|
|
6 #include "tree-vect.h"
|
|
7
|
|
8 #define N 256
|
|
9
|
|
10 extern int a[N+20];
|
|
11
|
|
12 /* The alignment of 'pa' is unknown.
|
|
13 Yet we do know that both the read access and write access have
|
|
14 the same alignment. Peeling to align one of the accesses will
|
|
15 align the other. */
|
|
16
|
|
17 __attribute__ ((noinline)) int
|
|
18 main1 (int * pa)
|
|
19 {
|
|
20 int i;
|
|
21
|
|
22 for (i = 0; i < N; i++)
|
|
23 {
|
|
24 pa[i] = pa[i] + 1;
|
|
25 }
|
|
26
|
|
27 return 0;
|
|
28 }
|
|
29
|
|
30 /* The alignment of 'a' is unknown.
|
|
31 Yet we do know that both the read access and write access have
|
|
32 the same alignment. Peeling to align one of the accesses will
|
|
33 align the other. */
|
|
34
|
|
35 __attribute__ ((noinline)) int
|
|
36 main2 ()
|
|
37 {
|
|
38 int i;
|
|
39
|
|
40 for (i = 0; i < N; i++)
|
|
41 {
|
|
42 a[i] = a[i] + 1;
|
|
43 }
|
|
44
|
|
45 return 0;
|
|
46 }
|
|
47
|
|
48 __attribute__ ((noinline)) int
|
|
49 main3 ()
|
|
50 {
|
|
51 int i;
|
|
52
|
|
53 for (i = 0; i < N; i++)
|
|
54 {
|
|
55 a[i] = a[i+20];
|
|
56 }
|
|
57
|
|
58 return 0;
|
|
59 }
|
|
60
|
|
61 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { xfail vect_no_int_add } } } */
|
|
62 /* { dg-final { scan-tree-dump-times "accesses have the same alignment." 3 "vect" { target { { vect_aligned_arrays } && {! vect_sizes_32B_16B} } } } } */
|
|
63 /* { dg-final { scan-tree-dump-times "accesses have the same alignment." 2 "vect" { target { {! vect_aligned_arrays } && {vect_sizes_32B_16B} } } } } */
|
|
64 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
|