comparison gcc/testsuite/gcc.dg/tree-ssa/cunroll-13.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* { dg-do compile } */ 1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fdisable-tree-evrp -fdisable-tree-cunrolli -fdisable-tree-vrp1 -fdump-tree-cunroll-blocks-details" } */ 2 /* { dg-options "-O3 -fgimple -fdump-tree-cunroll-blocks-details" } */
3 3
4 #if __SIZEOF_INT__ < 4 4 #if __SIZEOF_INT__ < 4
5 __extension__ typedef __INT32_TYPE__ i32; 5 __extension__ typedef __INT32_TYPE__ i32;
6 #else 6 #else
7 typedef int i32; 7 typedef int i32;
8 #endif 8 #endif
9 9
10 struct a {int a[8];int b;}; 10 struct a {i32 a[8];i32 b;};
11 void 11
12 t(struct a *a) 12 void __GIMPLE (startwith("fix_loops"))
13 t (struct a * a)
13 { 14 {
14 for (i32 i=0;i<123456 && a->a[i];i++) 15 i32 i;
15 a->a[i]++; 16 i32 _1;
17 i32 _2;
18 i32 _9;
19 i32 _11;
20
21 bb_2:
22 _11 = a_6(D)->a[0];
23 if (_11 != _Literal (i32) 0)
24 goto bb_6;
25 else
26 goto bb_3;
27
28 bb_3:
29 return;
30
31 bb_4:
32 _1 = _2 + 1;
33 a_6(D)->a[i_19] = _1;
34 i_8 = i_19 + _Literal (i32) 1;
35 if (i_8 <= _Literal (i32) 123455)
36 goto bb_5;
37 else
38 goto bb_3;
39
40 bb_5:
41 i_19 = __PHI (bb_6: _Literal (i32) 1, bb_4: i_8);
42 _2 = a_6(D)->a[i_19];
43 if (_2 != _Literal (i32) 0)
44 goto bb_4;
45 else
46 goto bb_3;
47
48 bb_6:
49 _9 = _11 + _Literal (i32) 1;
50 a_6(D)->a[0] = _9;
51 goto bb_5;
16 } 52 }
17 /* This pass relies on the fact that we do not eliminate the redundant test for i early. 53
18 It is necessary to disable all passes that do so. At the moment it is evrp, vrp1 and cunrolli. */ 54 /* This testcase relies on the fact that we do not eliminate the redundant test
55 for i early. It is necessary to disable all passes that do so, for the
56 moment starting with the loop pipeline is good enough. */
19 /* { dg-final { scan-tree-dump-times "Loop 1 iterates 123454 times" 1 "cunroll" } } */ 57 /* { dg-final { scan-tree-dump-times "Loop 1 iterates 123454 times" 1 "cunroll" } } */
20 /* { dg-final { scan-tree-dump-times "Last iteration exit edge was proved true" 1 "cunroll" } } */ 58 /* { dg-final { scan-tree-dump-times "Last iteration exit edge was proved true" 1 "cunroll" } } */
21 /* { dg-final { scan-tree-dump-times "Exit condition of peeled iterations was eliminated" 1 "cunroll" } } */ 59 /* { dg-final { scan-tree-dump-times "Exit condition of peeled iterations was eliminated" 1 "cunroll" } } */
22 /* { dg-final { scan-tree-dump-times "loop with 7 iterations completely unrolled" 1 "cunroll" } } */ 60 /* { dg-final { scan-tree-dump-times "loop with 6 iterations completely unrolled" 1 "cunroll" } } */
23 /* { dg-final { scan-tree-dump-not "Invalid sum" "cunroll" } } */ 61 /* { dg-final { scan-tree-dump-not "Invalid sum" "cunroll" } } */