Commit 85fab83d authored by Christian Würdig's avatar Christian Würdig
Browse files

added functions to get copy op

parent 36c6b998
......@@ -335,6 +335,10 @@ ir_node *be_new_Copy(const arch_register_class_t *cls, ir_graph *irg, ir_node *b
return res;
}
ir_node *be_get_Copy_op(const ir_node *cpy) {
return get_irn_n(cpy, be_pos_Copy_op);
}
ir_node *be_new_Keep(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, int n, ir_node *in[])
{
int i;
......@@ -913,7 +917,7 @@ static void *put_out_reg_req(arch_register_req_t *req, const ir_node *irn, int o
if(be_is_Copy(irn)) {
req->type |= arch_register_req_type_should_be_same;
req->other_same = get_irn_n(irn, be_pos_Copy_orig);
req->other_same = be_get_Copy_op(irn);
}
}
else {
......
......@@ -103,9 +103,11 @@ enum {
ir_node *be_new_Reload(const arch_register_class_t *cls, const arch_register_class_t *cls_frame, ir_graph *irg, ir_node *bl, ir_node *frame, ir_node *spill_node, ir_mode *mode);
enum {
be_pos_Copy_orig = 0
be_pos_Copy_op = 0
};
ir_node *be_new_Copy(const arch_register_class_t *cls, ir_graph *irg, ir_node *block, ir_node *in);
ir_node *be_get_Copy_op(const ir_node *cpy);
ir_node *be_new_Perm(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, int arity, ir_node *in[]);
ir_node *be_new_Keep(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, int arity, ir_node *in[]);
......
......@@ -627,7 +627,7 @@ static void dump_affinities_walker(ir_node *irn, void *env) {
/* copies have affinities */
if (arch_irn_classify(raenv->aenv, irn) == arch_irn_class_copy) {
ir_node *other = get_irn_n(irn, be_pos_Copy_orig);
ir_node *other = be_get_Copy_op(irn);
if (! arch_irn_is(raenv->aenv, other, ignore)) {
vi2 = get_var_info(other);
......
......@@ -597,7 +597,7 @@ static void remove_copies(belady_env_t *bel) {
user = get_irn_edge(get_irn_irg(irn), irn, 0)->src;
src = get_irn_n(irn, be_pos_Copy_orig);
src = be_get_Copy_op(irn);
set_irn_n(user, 0, src);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment