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 " } */
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
)
14 int t1
, t2
, t3
, t4
, t5
, t6
;
15 t1
= t2
= t3
= t4
= t5
= t6
= 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" } } */
31 /* { dg-final { cleanup-rtl-dump "loop2_invariant" } } */