Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_1.c

raw
1 /* { dg-add-options vect_early_break } */
2 /* { dg-require-effective-target vect_sizes_16B_8B } */
3 /* { dg-require-effective-target vect_early_break_hw } */
4 /* { dg-require-effective-target vect_int } */
5
6 /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
7
8 #include "tree-vect.h"
9
10 __attribute__ ((noipa))
11 int f (int a[12], int b[12], int n)
12 {
13 #ifdef __arm__
14 a = __builtin_assume_aligned (a, 8);
15 b = __builtin_assume_aligned (b, 8);
16 #else
17 a = __builtin_assume_aligned (a, 16);
18 b = __builtin_assume_aligned (b, 16);
19 #endif
20 for (int i = 0; i < n; i++)
21 {
22 if (b[i] == 0)
23 return 0;
24 if (a[0] > b[i])
25 return 1;
26 }
27 return 2;
28 }
29
30 int main ()
31 {
32 check_vect ();
33
34 int *a = 0;
35 int b[12] = {0};
36 return f (a, b, 10);
37 }
38
39 /* { dg-final { scan-tree-dump "not hoisting invariant load due to early break" "vect" } } */