1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-parallelize-loops=2" } */
6 typedef unsigned long HARD_REG_ELT_TYPE
;
7 typedef HARD_REG_ELT_TYPE HARD_REG_SET
[1];
10 HARD_REG_SET x_ira_prohibited_class_mode_regs
[1][1];
12 extern struct target_ira
*this_target_ira
;
14 ira_object_conflict_iter_cond ()
19 check_hard_reg_p (int num_objects
, int hard_regno
,
20 HARD_REG_SET
* conflict_regs
, HARD_REG_SET profitable_regs
)
25 x_ira_prohibited_class_mode_regs
)[0][0])[(hard_regno
) /
26 ((unsigned) (8 * 8))] &
27 (((HARD_REG_ELT_TYPE
) (1)) <<
28 ((hard_regno
) % ((unsigned) (8 * 8)))))))
31 for (j
= 0; j
< nregs
; j
++)
34 int set_to_test_start
= 0, set_to_test_end
= nwords
;
38 set_to_test_start
= nwords
- j
- 1;
40 set_to_test_start
= j
;
42 for (k
= set_to_test_start
; k
< set_to_test_end
; k
++)
44 ((conflict_regs
[k
])[(hard_regno
+ j
) / ((unsigned) (8 * 8))] &
45 (((HARD_REG_ELT_TYPE
) (1)) <<
46 ((hard_regno
+ j
) % ((unsigned) (8 * 8)))))))
48 if (k
!= set_to_test_end
)
55 improve_allocation (void)
57 int j
, k
, n
, hregno
, conflict_hregno
, base_cost
, class_size
, word
, nwords
;
58 int check
, spill_cost
, min_cost
, nregs
, conflict_nregs
, r
, best
;
60 HARD_REG_SET conflicting_regs
[2], profitable_hard_regs
;
65 for (word
= 0; word
< nwords
; word
++)
67 for (; ira_object_conflict_iter_cond ();)
69 for (r
= conflict_hregno
;
70 r
< conflict_hregno
+ conflict_nregs
; r
++)
72 (a
, r
, conflicting_regs
, profitable_hard_regs
))
73 costs
[r
] += spill_cost
;
76 (a
, hregno
, conflicting_regs
, profitable_hard_regs
)
77 && min_cost
> costs
[hregno
])
81 for (; ira_object_conflict_iter_cond ();)
83 if (best
+ nregs
<= conflict_hregno
84 || conflict_hregno
+ conflict_nregs
<= best
)