* Backend node support for generic backend nodes.
* This file provides Perm, Copy, Spill and Reload nodes.
*/
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
#include <stdlib.h>
return _node_cmp_attr(&a_attr->node_attr, &b_attr->node_attr);
}
-static INLINE be_req_t *get_be_req(const ir_node *node, int pos)
+static inline be_req_t *get_be_req(const ir_node *node, int pos)
{
int idx;
const be_node_attr_t *attr;
return pos < 0 ? &rd->req : &rd->in_req;
}
-static INLINE arch_register_req_t *get_req(const ir_node *node, int pos)
+static inline arch_register_req_t *get_req(const ir_node *node, int pos)
{
be_req_t *bereq = get_be_req(node, pos);
return &bereq->req;
if (get_irn_mode(irn) == mode_T)
return arch_no_register_req;
+ assert(pos == -1);
out_pos = redir_proj((const ir_node **)&irn);
assert(is_be_node(irn));
return get_out_reg_req(irn, out_pos);
irn = get_Proj_pred(irn);
}
goto restart;
- break;
+
default:
- return arch_irn_class_normal;
+ return 0;
}
-
- return 0;
}
static arch_irn_flags_t be_node_get_flags(const ir_node *node)
arch_irn_flags_t flags;
} phi_attr_t;
-struct {
- arch_env_t *arch_env;
- pmap *phi_attrs;
+static struct {
+ pmap *phi_attrs;
} phi_handler;
#define get_phi_handler_from_ops(h) container_of(h, phi_handler_t, irn_ops)
-static INLINE
+static inline
phi_attr_t *get_Phi_attr(const ir_node *phi)
{
phi_attr_t *attr = pmap_get(phi_handler.phi_attrs, (void*) phi);
/* Matze: don't we unnecessary constraint our phis with this?
* we only need to take the regclass IMO*/
if(!is_Phi(op))
- return arch_get_register_req(op, BE_OUT_POS(0));
+ return arch_get_register_req_out(op);
}
/*
static arch_irn_class_t phi_classify(const ir_node *irn)
{
(void) irn;
- return arch_irn_class_normal;
+ return 0;
}
static arch_irn_flags_t phi_get_flags(const ir_node *irn)
NULL, /* perform_memory_operand */
};
-void be_phi_handler_new(be_main_env_t *env)
+void be_phi_handler_new(void)
{
- phi_handler.arch_env = env->arch_env;
phi_handler.phi_attrs = pmap_create();
op_Phi->ops.be_ops = &phi_irn_ops;
}