PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / ira-loop-pressure.c
blobcf06c27031c628e3fac76a7c42240afa2bcfe302
1 /* Loop2_invariants pass should distinguish register pressures of different
2 register classes. In this case, register pressue of INT is high. But
3 we can still move the FP invariant out of the loop. */
5 /* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
6 /* { dg-options "-O2 -fira-loop-pressure -fdump-rtl-loop2_invariant " } */
8 float tt;
9 extern void foo2 (int *, int *, int *, int *, int *, int *);
10 extern int foo3 (int, int, int, int, int, int);
11 int foo (int a, int b, int c, int d)
13 int i = a;
14 int t1, t2, t3, t4, t5, t6;
15 t1 = t2 = t3 = t4 = t5 = t6 = 0;
17 for (; i > 0; i += c)
19 tt += 123456.0;
20 if (d > t1 + t2)
21 tt = 3.0;
22 foo2 (&t1, &t2, &t3, &t4, &t5, &t6);
23 t1 += t3 + t4 + a + b;
24 t2 -= t5 - t6 - c - d;
27 return foo3 (t1, t2, t3, t4, t5, t6);
30 /* { dg-final { scan-rtl-dump "Decided to move invariant" "loop2_invariant" } } */