Debian Codegraph @

gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c

raw
1 /* { dg-options "-O2 -fdump-tree-optimized-details-blocks -fdump-ipa-profile-optimized" } */
2 int a[1000];
3 int b = 256;
4 int c = 257;
5 int
6 main ()
7 {
8 int i;
9 int n;
10 for (i = 0; i < 1000; i++)
11 {
12 if (i % 17)
13 n = c;
14 else n = b;
15 a[i] /= n;
16 }
17 return 0;
18 }
19 /* autofdo does not do value profiling so far */
20 /* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: div.mod by constant 257" "profile"} } */
21 /* { dg-final-use-not-autofdo { scan-tree-dump "if \\(n_\[0-9\]* != 257\\)" "optimized"} } */
22 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */