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
3611de8c
Commit
3611de8c
authored
Oct 02, 2008
by
yb9976
Browse files
Reuse prevents_AM check in PBQP transformer.
[r22407]
parent
879f5c59
Changes
3
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_common_transform.c
View file @
3611de8c
...
...
@@ -863,6 +863,45 @@ const arch_register_req_t *parse_clobber(const char *clobber)
return
req
;
}
int
prevents_AM
(
ir_node
*
const
block
,
ir_node
*
const
am_candidate
,
ir_node
*
const
other
)
{
if
(
get_nodes_block
(
other
)
!=
block
)
return
0
;
if
(
is_Sync
(
other
))
{
int
i
;
for
(
i
=
get_Sync_n_preds
(
other
)
-
1
;
i
>=
0
;
--
i
)
{
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
1
;
}
return
0
;
}
else
{
/* Do not block ourselves from getting eaten */
if
(
is_Proj
(
other
)
&&
get_Proj_pred
(
other
)
==
am_candidate
)
return
0
;
if
(
!
heights_reachable_in_block
(
heights
,
other
,
am_candidate
))
return
0
;
return
1
;
}
}
ir_node
*
try_create_Immediate
(
ir_node
*
node
,
char
immediate_constraint_type
)
{
int
minus
=
0
;
...
...
ir/be/ia32/ia32_common_transform.h
View file @
3611de8c
...
...
@@ -110,6 +110,12 @@ const arch_register_req_t *make_register_req(const constraint_t *constraint,
const
arch_register_req_t
*
parse_clobber
(
const
char
*
clobber
);
/**
* Checks whether other node inputs depend on the am_candidate (via mem-proj).
*/
int
prevents_AM
(
ir_node
*
const
block
,
ir_node
*
const
am_candidate
,
ir_node
*
const
other
);
ir_node
*
try_create_Immediate
(
ir_node
*
node
,
char
immediate_constraint_type
);
#endif
/* FIRM_BE_IA32_IA32_COMMON_TRANSFORM_H */
ir/be/ia32/ia32_transform.c
View file @
3611de8c
...
...
@@ -433,44 +433,6 @@ ir_entity *ia32_gen_fp_known_const(ia32_known_const_t kct) {
return
ent_cache
[
kct
];
}
static
int
prevents_AM
(
ir_node
*
const
block
,
ir_node
*
const
am_candidate
,
ir_node
*
const
other
)
{
if
(
get_nodes_block
(
other
)
!=
block
)
return
0
;
if
(
is_Sync
(
other
))
{
int
i
;
for
(
i
=
get_Sync_n_preds
(
other
)
-
1
;
i
>=
0
;
--
i
)
{
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
1
;
}
return
0
;
}
else
{
/* Do not block ourselves from getting eaten */
if
(
is_Proj
(
other
)
&&
get_Proj_pred
(
other
)
==
am_candidate
)
return
0
;
if
(
!
heights_reachable_in_block
(
heights
,
other
,
am_candidate
))
return
0
;
return
1
;
}
}
/**
* return true if the node is a Proj(Load) and could be used in source address
* mode for another node. Will return only true if the @p other node is not
...
...
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