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
a572aa3c
Commit
a572aa3c
authored
Mar 08, 2011
by
Matthias Braun
Browse files
fix bestate code not respecting prolog/epilog
parent
8737c443
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/bestate.c
View file @
a572aa3c
...
...
@@ -135,7 +135,8 @@ static spill_info_t *create_spill(minibelady_env_t *env, ir_node *state, int for
do
{
after
=
next
;
next
=
sched_next
(
after
);
}
while
(
is_Proj
(
next
)
||
is_Phi
(
next
)
||
be_is_Keep
(
next
));
}
while
(
is_Proj
(
next
)
||
is_Phi
(
next
)
||
be_is_Keep
(
next
)
||
(
arch_irn_get_flags
(
next
)
&
arch_irn_flags_prolog
));
}
else
{
after
=
state
;
}
...
...
@@ -351,6 +352,17 @@ static block_info_t *compute_block_start_state(minibelady_env_t *env, ir_node *b
return
block_info
;
}
static
ir_node
*
get_reload_point
(
ir_node
*
before
)
{
while
(
true
)
{
ir_node
*
prev
=
sched_prev
(
before
);
if
(
!
(
arch_irn_get_flags
(
prev
)
&
arch_irn_flags_epilog
))
break
;
before
=
prev
;
}
return
before
;
}
/**
* For the given block @p block, decide for each values
* whether it is used from a register or is reloaded
...
...
@@ -408,7 +420,8 @@ static void belady(minibelady_env_t *env, ir_node *block)
/* create a reload to match state if necessary */
if
(
need_val
!=
NULL
&&
need_val
!=
current_state
)
{
DBG
((
dbg
,
LEVEL_3
,
"
\t
... reloading %+F
\n
"
,
need_val
));
create_reload
(
env
,
need_val
,
node
,
current_state
);
ir_node
*
before
=
get_reload_point
(
node
);
create_reload
(
env
,
need_val
,
before
,
current_state
);
current_state
=
need_val
;
}
...
...
Write
Preview
Markdown
is supported
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