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
3af72e1a
Commit
3af72e1a
authored
Aug 26, 2015
by
Christoph Mallon
Browse files
bespillutil: Add and use be_new_Copy_for_input().
parent
7670bd0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/bespillutil.c
View file @
3af72e1a
...
...
@@ -678,6 +678,14 @@ void be_insert_spills_reloads(spill_env_t *env)
be_timer_pop
(
T_RA_SPILL_APPLY
);
}
static
void
be_new_Copy_for_input
(
ir_node
*
const
val
,
ir_node
*
const
before
,
int
const
pos
)
{
ir_node
*
const
block
=
get_nodes_block
(
before
);
ir_node
*
const
copy
=
be_new_Copy
(
block
,
val
);
sched_add_before
(
before
,
copy
);
set_irn_n
(
before
,
pos
,
copy
);
}
static
be_irg_t
*
birg
;
static
be_lv_t
*
lv
;
static
unsigned
long
precol_copies
;
...
...
@@ -707,13 +715,9 @@ static void prepare_constr_insn(ir_node *const node)
if
(
rbitset_is_set
(
req
->
limited
,
reg
->
index
))
continue
;
ir_node
*
block
=
get_nodes_block
(
node
);
ir_node
*
copy
=
be_new_Copy
(
block
,
op
);
sched_add_before
(
node
,
copy
);
set_irn_n
(
node
,
i
,
copy
);
be_new_Copy_for_input
(
op
,
node
,
i
);
++
precol_copies
;
DBG
((
dbg_constr
,
LEVEL_3
,
"inserting ignore arg copy %+F for %+F pos %d
\n
"
,
copy
,
node
,
i
));
DBG
((
dbg_constr
,
LEVEL_3
,
"inserting ignore arg copy for %+F pos %d
\n
"
,
node
,
i
));
}
/* insert copies for nodes that occur constrained more than once. */
...
...
@@ -745,14 +749,9 @@ static void prepare_constr_insn(ir_node *const node)
if
(
rbitsets_equal
(
req
->
limited
,
req2
->
limited
,
cls
->
n_regs
))
continue
;
ir_node
*
block
=
get_nodes_block
(
node
);
ir_node
*
copy
=
be_new_Copy
(
block
,
in
);
sched_add_before
(
node
,
copy
);
set_irn_n
(
node
,
i2
,
copy
);
be_new_Copy_for_input
(
in
,
node
,
i2
);
++
multi_precol_copies
;
DBG
((
dbg_constr
,
LEVEL_3
,
"inserting multiple constr copy %+F for %+F pos %d
\n
"
,
copy
,
node
,
i2
));
DBG
((
dbg_constr
,
LEVEL_3
,
"inserting multiple constr copy for %+F pos %d
\n
"
,
node
,
i2
));
}
}
...
...
@@ -814,13 +813,9 @@ static void prepare_constr_insn(ir_node *const node)
* register change for free), need to add some SSA-reconstruction code
* to achieve this. */
ir_node
*
block
=
get_nodes_block
(
node
);
ir_node
*
copy
=
be_new_Copy
(
block
,
in
);
sched_add_before
(
node
,
copy
);
set_irn_n
(
node
,
i
,
copy
);
be_new_Copy_for_input
(
in
,
node
,
i
);
++
constrained_livethrough_copies
;
DBG
((
dbg_constr
,
LEVEL_3
,
"inserting constr copy %+F for %+F pos %d
\n
"
,
copy
,
node
,
i
));
DBG
((
dbg_constr
,
LEVEL_3
,
"inserting constr copy for %+F pos %d
\n
"
,
node
,
i
));
be_liveness_update
(
lv
,
in
);
}
}
...
...
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