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
dbd58c51
Commit
dbd58c51
authored
Sep 17, 2011
by
Matthias Braun
Browse files
add missing keeps after rematerializing nodes
parent
65f2648b
Changes
3
Hide whitespace changes
Inline
Side-by-side
ir/be/beabihelper.c
View file @
dbd58c51
...
...
@@ -411,7 +411,7 @@ static ir_node *add_to_keep(ir_node *last_keep,
return
last_keep
;
}
static
void
add_missing_keep
_walker
(
ir_node
*
node
,
void
*
data
)
void
be_
add_missing_keep
s_node
(
ir_node
*
node
)
{
int
n_outs
,
i
;
unsigned
*
found_projs
;
...
...
@@ -419,7 +419,7 @@ static void add_missing_keep_walker(ir_node *node, void *data)
ir_mode
*
mode
=
get_irn_mode
(
node
);
ir_node
*
last_keep
;
ir_node
**
existing_projs
;
(
void
)
data
;
if
(
mode
!=
mode_T
)
{
if
(
!
has_real_user
(
node
))
{
const
arch_register_req_t
*
req
=
arch_get_irn_register_req
(
node
);
...
...
@@ -483,6 +483,12 @@ static void add_missing_keep_walker(ir_node *node, void *data)
}
}
static
void
add_missing_keep_walker
(
ir_node
*
node
,
void
*
data
)
{
(
void
)
data
;
be_add_missing_keeps_node
(
node
);
}
void
be_add_missing_keeps
(
ir_graph
*
irg
)
{
irg_walk_graph
(
irg
,
add_missing_keep_walker
,
NULL
,
NULL
);
...
...
ir/be/beabihelper.h
View file @
dbd58c51
...
...
@@ -113,6 +113,11 @@ ir_node *be_epilog_create_return(beabi_helper_env_t *env, dbg_info *dbgi,
*/
void
be_add_missing_keeps
(
ir_graph
*
irg
);
/**
* Make sure all outputs of a node are used, add keeps otherwise
*/
void
be_add_missing_keeps_node
(
ir_node
*
node
);
/**
* In the normal firm representation some nodes like pure calls, builtins
* have no memory inputs+outputs. However in the backend these sometimes have to
...
...
ir/be/beflags.c
View file @
dbd58c51
...
...
@@ -54,6 +54,7 @@
#include
"besched.h"
#include
"benode.h"
#include
"belive.h"
#include
"beabihelper.h"
static
const
arch_register_class_t
*
flag_class
;
static
const
arch_register_t
*
flags_reg
;
...
...
@@ -161,6 +162,7 @@ static void rematerialize_or_move(ir_node *flags_needed, ir_node *node,
if
(
get_irn_mode
(
copy
)
==
mode_T
)
{
ir_mode
*
mode
=
flag_class
->
mode
;
value
=
new_rd_Proj
(
NULL
,
copy
,
mode
,
pn
);
be_add_missing_keeps_node
(
copy
);
}
else
{
value
=
copy
;
}
...
...
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