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
9b40b4da
Commit
9b40b4da
authored
Oct 15, 2016
by
Christoph Mallon
Browse files
ia32: Factor out duplicate code in prevents_AM().
parent
d43ea9e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_transform.c
View file @
9b40b4da
...
...
@@ -573,6 +573,18 @@ static ir_node *gen_Unknown(ir_node *node)
return
res
;
}
static
bool
prevents_AM_one
(
ir_node
*
const
other
,
ir_node
*
const
am_candidate
)
{
/* Do not block ourselves from getting eaten */
if
(
is_Proj
(
other
)
&&
get_Proj_pred
(
other
)
==
am_candidate
)
return
false
;
if
(
!
heights_reachable_in_block
(
heights
,
other
,
am_candidate
))
return
false
;
return
true
;
}
/**
* Checks whether other node inputs depend on the am_candidate (via mem-proj).
*/
...
...
@@ -585,31 +597,14 @@ static bool prevents_AM(ir_node *const block, ir_node *const am_candidate,
if
(
is_Sync
(
other
))
{
for
(
int
i
=
get_Sync_n_preds
(
other
);
i
--
!=
0
;)
{
ir_node
*
const
pred
=
get_Sync_pred
(
other
,
i
);
if
(
get_nodes_block
(
pred
)
!=
block
)
continue
;
/* Do not block ourselves from getting eaten */
if
(
is_Proj
(
pred
)
&&
get_Proj_pred
(
pred
)
==
am_candidate
)
continue
;
if
(
!
heights_reachable_in_block
(
heights
,
pred
,
am_candidate
))
continue
;
return
true
;
if
(
get_nodes_block
(
pred
)
==
block
&&
prevents_AM_one
(
pred
,
am_candidate
))
return
true
;
}
return
false
;
}
/* Do not block ourselves from getting eaten */
if
(
is_Proj
(
other
)
&&
get_Proj_pred
(
other
)
==
am_candidate
)
return
false
;
if
(
!
heights_reachable_in_block
(
heights
,
other
,
am_candidate
))
return
false
;
return
true
;
return
prevents_AM_one
(
other
,
am_candidate
);
}
static
bool
cmp_can_use_sub_flags
(
ir_node
*
cmp
,
ir_node
*
sub
,
bool
*
swap
)
...
...
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