annotate gcc/testsuite/gcc.dg/ira-loop-pressure.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Loop2_invariants pass should distinguish register pressures of different
kono
parents:
diff changeset
2 register classes. In this case, register pressue of INT is high. But
kono
parents:
diff changeset
3 we can still move the FP invariant out of the loop. */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 /* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
kono
parents:
diff changeset
6 /* { dg-options "-O2 -fira-loop-pressure -fdump-rtl-loop2_invariant " } */
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 float tt;
kono
parents:
diff changeset
9 extern void foo2 (int *, int *, int *, int *, int *, int *);
kono
parents:
diff changeset
10 extern int foo3 (int, int, int, int, int, int);
kono
parents:
diff changeset
11 int foo (int a, int b, int c, int d)
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 int i = a;
kono
parents:
diff changeset
14 int t1, t2, t3, t4, t5, t6;
kono
parents:
diff changeset
15 t1 = t2 = t3 = t4 = t5 = t6 = 0;
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 for (; i > 0; i += c)
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 tt += 123456.0;
kono
parents:
diff changeset
20 if (d > t1 + t2)
kono
parents:
diff changeset
21 tt = 3.0;
kono
parents:
diff changeset
22 foo2 (&t1, &t2, &t3, &t4, &t5, &t6);
kono
parents:
diff changeset
23 t1 += t3 + t4 + a + b;
kono
parents:
diff changeset
24 t2 -= t5 - t6 - c - d;
kono
parents:
diff changeset
25 }
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 return foo3 (t1, t2, t3, t4, t5, t6);
kono
parents:
diff changeset
28 }
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 /* { dg-final { scan-rtl-dump "Decided to move invariant" "loop2_invariant" } } */
kono
parents:
diff changeset
31