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
8e31f7fa
Commit
8e31f7fa
authored
Dec 19, 2012
by
Christoph Mallon
Browse files
becopyopt: Simplify co_dump_appel_disjoint_constraints().
parent
34e3b8d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/becopyopt.c
View file @
8e31f7fa
...
...
@@ -821,25 +821,17 @@ int co_gs_is_optimizable(copy_opt_t const *const co, ir_node *const irn)
return
n
&&
n
->
neighbours
;
}
static
int
co_dump_appel_disjoint_constraints
(
const
copy_opt_t
*
co
,
ir_node
*
a
,
ir_node
*
b
)
static
bool
co_dump_appel_disjoint_constraints
(
ir_node
*
const
a
,
ir_node
*
const
b
)
{
ir_node
*
nodes
[]
=
{
a
,
b
}
;
bitset_t
*
constr
[]
=
{
NULL
,
NULL
};
int
j
;
arch_register_req_t
const
*
const
reqa
=
arch_get_irn_register_req
(
a
)
;
if
(
!
arch_register_req_is
(
reqa
,
limited
))
return
false
;
constr
[
0
]
=
bitset_alloca
(
co
->
cls
->
n_regs
);
constr
[
1
]
=
bitset_alloca
(
co
->
cls
->
n_regs
);
arch_register_req_t
const
*
const
reqb
=
arch_get_irn_register_req
(
b
);
if
(
!
arch_register_req_is
(
reqb
,
limited
))
return
false
;
for
(
j
=
0
;
j
<
2
;
++
j
)
{
const
arch_register_req_t
*
req
=
arch_get_irn_register_req
(
nodes
[
j
]);
if
(
arch_register_req_is
(
req
,
limited
))
rbitset_copy_to_bitset
(
req
->
limited
,
constr
[
j
]);
else
bitset_set_all
(
constr
[
j
]);
}
return
!
bitset_intersect
(
constr
[
0
],
constr
[
1
]);
return
!
rbitsets_have_common
(
reqa
->
limited
,
reqb
->
limited
,
reqa
->
cls
->
n_regs
);
}
/**
...
...
@@ -902,7 +894,7 @@ static void co_dump_appel_graph(const copy_opt_t *co, FILE *f)
be_ifg_foreach_neighbour
(
ifg
,
&
nit
,
irn
,
adj
)
{
if
(
!
arch_irn_is_ignore
(
adj
)
&&
!
co_dump_appel_disjoint_constraints
(
co
,
irn
,
adj
))
{
!
co_dump_appel_disjoint_constraints
(
irn
,
adj
))
{
int
adj_idx
=
node_map
[
get_irn_idx
(
adj
)];
if
(
idx
<
adj_idx
)
fprintf
(
f
,
"%d %d -1
\n
"
,
idx
,
adj_idx
);
...
...
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