Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
58765e7a
Commit
58765e7a
authored
Dec 19, 2012
by
Christoph Mallon
Browse files
becopyilp: Use the set of admissible registers from bechordal.
parent
ac14a2bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/be/becopyilp.c
View file @
58765e7a
...
...
@@ -139,23 +139,18 @@ static void sr_remove(ilp_env_t *const ienv)
*/
static
void
sr_reinsert
(
ilp_env_t
*
const
ienv
)
{
ir_graph
*
irg
=
ienv
->
co
->
irg
;
be_ifg_t
*
ifg
=
ienv
->
co
->
cenv
->
ifg
;
unsigned
n_regs
=
arch_register_class_n_regs
(
ienv
->
co
->
cls
);
unsigned
*
const
allocatable_cols
=
rbitset_alloca
(
n_regs
);
be_set_allocatable_regs
(
irg
,
ienv
->
co
->
cls
,
allocatable_cols
);
unsigned
*
const
possible_cols
=
rbitset_alloca
(
n_regs
);
neighbours_iter_t
iter
;
/* color the removed nodes in right order */
unsigned
const
n_regs
=
arch_register_class_n_regs
(
ienv
->
co
->
cls
);
unsigned
*
const
possible_cols
=
rbitset_alloca
(
n_regs
);
unsigned
const
*
const
allocatable_cols
=
ienv
->
co
->
cenv
->
allocatable_regs
->
data
;
be_ifg_t
const
*
const
ifg
=
ienv
->
co
->
cenv
->
ifg
;
for
(
size_t
i
=
ARR_LEN
(
ienv
->
col_suff
);
i
--
!=
0
;)
{
ir_node
*
const
irn
=
ienv
->
col_suff
[
i
];
rbitset_copy
(
possible_cols
,
allocatable_cols
,
n_regs
);
/* get free color by inspecting all neighbors */
neighbours_iter_t
iter
;
be_ifg_foreach_neighbour
(
ifg
,
&
iter
,
irn
,
other
)
{
const
arch_register_req_t
*
cur_req
;
unsigned
cur_col
;
...
...
ir/be/becopyilp2.c
View file @
58765e7a
...
...
@@ -598,26 +598,18 @@ static void ilp2_apply(ilp_env_t *ienv)
*/
static
int
co_solve_ilp2
(
copy_opt_t
*
co
)
{
unsigned
n_regs
=
arch_register_class_n_regs
(
co
->
cls
);
lpp_sol_state_t
sol_state
;
ilp_env_t
*
ienv
;
local_env_t
my
;
ASSERT_OU_AVAIL
(
co
);
//See build_clique_st
ASSERT_GS_AVAIL
(
co
);
my
.
first_x_var
=
-
1
;
my
.
last_x_var
=
-
1
;
FIRM_DBG_REGISTER
(
dbg
,
"firm.be.coilp2"
);
unsigned
*
const
allocatable_colors
=
rbitset_alloca
(
n_regs
);
be_set_allocatable_regs
(
co
->
irg
,
co
->
cls
,
allocatable_colors
);
my
.
allocatable_colors
=
allocatable_colors
;
ienv
=
new_ilp_env
(
co
,
ilp2_build
,
ilp2_apply
,
&
my
);
sol_state
=
ilp_go
(
ienv
);
local_env_t
my
;
my
.
first_x_var
=
-
1
;
my
.
last_x_var
=
-
1
;
my
.
allocatable_colors
=
co
->
cenv
->
allocatable_regs
->
data
;
ilp_env_t
*
const
ienv
=
new_ilp_env
(
co
,
ilp2_build
,
ilp2_apply
,
&
my
);
lpp_sol_state_t
const
sol_state
=
ilp_go
(
ienv
);
free_ilp_env
(
ienv
);
return
sol_state
==
lpp_optimal
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment