Commit 5530877c authored by Matthias Braun's avatar Matthias Braun
Browse files

be: get rid of arch_irn_classify callback

parent c2e55800
...@@ -55,12 +55,6 @@ ...@@ -55,12 +55,6 @@
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
static arch_irn_class_t TEMPLATE_classify(const ir_node *irn)
{
(void) irn;
return arch_irn_class_none;
}
static ir_entity *TEMPLATE_get_frame_entity(const ir_node *node) static ir_entity *TEMPLATE_get_frame_entity(const ir_node *node)
{ {
(void) node; (void) node;
...@@ -88,7 +82,6 @@ static int TEMPLATE_get_sp_bias(const ir_node *irn) ...@@ -88,7 +82,6 @@ static int TEMPLATE_get_sp_bias(const ir_node *irn)
/* fill register allocator interface */ /* fill register allocator interface */
static const arch_irn_ops_t TEMPLATE_irn_ops = { static const arch_irn_ops_t TEMPLATE_irn_ops = {
TEMPLATE_classify,
TEMPLATE_get_frame_entity, TEMPLATE_get_frame_entity,
TEMPLATE_set_frame_offset, TEMPLATE_set_frame_offset,
TEMPLATE_get_sp_bias, TEMPLATE_get_sp_bias,
......
...@@ -57,12 +57,6 @@ ...@@ -57,12 +57,6 @@
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
static arch_irn_class_t amd64_classify(const ir_node *irn)
{
(void) irn;
return arch_irn_class_none;
}
static ir_entity *amd64_get_frame_entity(const ir_node *node) static ir_entity *amd64_get_frame_entity(const ir_node *node)
{ {
if (is_amd64_FrameAddr(node)) { if (is_amd64_FrameAddr(node)) {
...@@ -113,7 +107,6 @@ static int amd64_get_sp_bias(const ir_node *irn) ...@@ -113,7 +107,6 @@ static int amd64_get_sp_bias(const ir_node *irn)
/* fill register allocator interface */ /* fill register allocator interface */
static const arch_irn_ops_t amd64_irn_ops = { static const arch_irn_ops_t amd64_irn_ops = {
amd64_classify,
amd64_get_frame_entity, amd64_get_frame_entity,
amd64_set_frame_offset, amd64_set_frame_offset,
amd64_get_sp_bias, amd64_get_sp_bias,
......
...@@ -66,13 +66,6 @@ ...@@ -66,13 +66,6 @@
#include "arm_emitter.h" #include "arm_emitter.h"
#include "arm_map_regs.h" #include "arm_map_regs.h"
static arch_irn_class_t arm_classify(const ir_node *irn)
{
(void) irn;
/* TODO: we should mark reload/spill instructions and classify them here */
return arch_irn_class_none;
}
static ir_entity *arm_get_frame_entity(const ir_node *irn) static ir_entity *arm_get_frame_entity(const ir_node *irn)
{ {
const arm_attr_t *attr = get_arm_attr_const(irn); const arm_attr_t *attr = get_arm_attr_const(irn);
...@@ -118,7 +111,6 @@ static int arm_get_sp_bias(const ir_node *irn) ...@@ -118,7 +111,6 @@ static int arm_get_sp_bias(const ir_node *irn)
/* fill register allocator interface */ /* fill register allocator interface */
static const arch_irn_ops_t arm_irn_ops = { static const arch_irn_ops_t arm_irn_ops = {
arm_classify,
arm_get_frame_entity, arm_get_frame_entity,
arm_set_stack_bias, arm_set_stack_bias,
arm_get_sp_bias, arm_get_sp_bias,
......
...@@ -212,12 +212,6 @@ const arch_register_req_t *arch_get_irn_register_req(const ir_node *node) ...@@ -212,12 +212,6 @@ const arch_register_req_t *arch_get_irn_register_req(const ir_node *node)
return out->req; return out->req;
} }
arch_irn_class_t arch_irn_classify(const ir_node *node)
{
const arch_irn_ops_t *ops = get_irn_ops(node);
return ops->classify(node);
}
arch_irn_flags_t arch_get_irn_flags(const ir_node *node) arch_irn_flags_t arch_get_irn_flags(const ir_node *node)
{ {
backend_info_t *info; backend_info_t *info;
......
...@@ -110,19 +110,6 @@ void arch_dump_register_req(FILE *F, const arch_register_req_t *req, ...@@ -110,19 +110,6 @@ void arch_dump_register_req(FILE *F, const arch_register_req_t *req,
void arch_dump_register_reqs(FILE *F, const ir_node *node); void arch_dump_register_reqs(FILE *F, const ir_node *node);
void arch_dump_reqs_and_registers(FILE *F, const ir_node *node); void arch_dump_reqs_and_registers(FILE *F, const ir_node *node);
/**
* Node classification. Used for statistics and for detecting reload nodes.
*/
typedef enum arch_irn_class_t {
arch_irn_class_none = 0,
arch_irn_class_spill = 1 << 0,
arch_irn_class_reload = 1 << 1,
arch_irn_class_remat = 1 << 2,
arch_irn_class_copy = 1 << 3,
arch_irn_class_perm = 1 << 4
} arch_irn_class_t;
ENUM_BITSET(arch_irn_class_t)
void arch_set_frame_offset(ir_node *irn, int bias); void arch_set_frame_offset(ir_node *irn, int bias);
ir_entity *arch_get_frame_entity(const ir_node *irn); ir_entity *arch_get_frame_entity(const ir_node *irn);
...@@ -224,13 +211,6 @@ static inline unsigned arch_get_irn_n_outs(const ir_node *node) ...@@ -224,13 +211,6 @@ static inline unsigned arch_get_irn_n_outs(const ir_node *node)
return (unsigned)ARR_LEN(info->out_infos); return (unsigned)ARR_LEN(info->out_infos);
} }
/**
* Classify a node.
* @param irn The node.
* @return A classification of the node.
*/
arch_irn_class_t arch_irn_classify(const ir_node *irn);
/** /**
* Initialize the architecture environment struct. * Initialize the architecture environment struct.
* @param isa The isa which shall be put into the environment. * @param isa The isa which shall be put into the environment.
...@@ -376,13 +356,6 @@ struct arch_inverse_t { ...@@ -376,13 +356,6 @@ struct arch_inverse_t {
struct arch_irn_ops_t { struct arch_irn_ops_t {
/**
* Classify the node.
* @param irn The node.
* @return A classification.
*/
arch_irn_class_t (*classify)(const ir_node *irn);
/** /**
* Get the entity on the stack frame this node depends on. * Get the entity on the stack frame this node depends on.
* @param irn The node in question. * @param irn The node in question.
......
...@@ -953,17 +953,6 @@ int be_get_IncSP_align(const ir_node *irn) ...@@ -953,17 +953,6 @@ int be_get_IncSP_align(const ir_node *irn)
return a->align; return a->align;
} }
static arch_irn_class_t be_node_classify(const ir_node *irn)
{
switch (get_irn_opcode(irn)) {
case beo_Spill: return arch_irn_class_spill;
case beo_Reload: return arch_irn_class_reload;
case beo_Perm: return arch_irn_class_perm;
case beo_Copy: return arch_irn_class_copy;
default: return arch_irn_class_none;
}
}
static ir_entity *be_node_get_frame_entity(const ir_node *irn) static ir_entity *be_node_get_frame_entity(const ir_node *irn)
{ {
return be_get_frame_entity(irn); return be_get_frame_entity(irn);
...@@ -1004,7 +993,6 @@ static int be_node_get_sp_bias(const ir_node *irn) ...@@ -1004,7 +993,6 @@ static int be_node_get_sp_bias(const ir_node *irn)
/* for be nodes */ /* for be nodes */
static const arch_irn_ops_t be_node_irn_ops = { static const arch_irn_ops_t be_node_irn_ops = {
be_node_classify,
be_node_get_frame_entity, be_node_get_frame_entity,
be_node_set_frame_offset, be_node_set_frame_offset,
be_node_get_sp_bias, be_node_get_sp_bias,
...@@ -1071,12 +1059,6 @@ int be_find_return_reg_input(ir_node *ret, const arch_register_t *reg) ...@@ -1071,12 +1059,6 @@ int be_find_return_reg_input(ir_node *ret, const arch_register_t *reg)
panic("Tried querying undefined register '%s' at Return", reg->name); panic("Tried querying undefined register '%s' at Return", reg->name);
} }
static arch_irn_class_t dummy_classify(const ir_node *node)
{
(void) node;
return arch_irn_class_none;
}
static ir_entity* dummy_get_frame_entity(const ir_node *node) static ir_entity* dummy_get_frame_entity(const ir_node *node)
{ {
(void) node; (void) node;
...@@ -1098,7 +1080,6 @@ static int dummy_get_sp_bias(const ir_node *node) ...@@ -1098,7 +1080,6 @@ static int dummy_get_sp_bias(const ir_node *node)
/* for "middleend" nodes */ /* for "middleend" nodes */
static const arch_irn_ops_t dummy_be_irn_ops = { static const arch_irn_ops_t dummy_be_irn_ops = {
dummy_classify,
dummy_get_frame_entity, dummy_get_frame_entity,
dummy_set_frame_offset, dummy_set_frame_offset,
dummy_get_sp_bias, dummy_get_sp_bias,
...@@ -1178,7 +1159,6 @@ void be_dump_phi_reg_reqs(FILE *F, ir_node *node, dump_reason_t reason) ...@@ -1178,7 +1159,6 @@ void be_dump_phi_reg_reqs(FILE *F, ir_node *node, dump_reason_t reason)
} }
static const arch_irn_ops_t phi_irn_ops = { static const arch_irn_ops_t phi_irn_ops = {
dummy_classify,
dummy_get_frame_entity, dummy_get_frame_entity,
dummy_set_frame_offset, dummy_set_frame_offset,
dummy_get_sp_bias, dummy_get_sp_bias,
......
...@@ -163,19 +163,10 @@ static void node_stat_walker(ir_node *irn, void *data) ...@@ -163,19 +163,10 @@ static void node_stat_walker(ir_node *irn, void *data)
} else { } else {
(*stats)[BE_STAT_PHIS]++; (*stats)[BE_STAT_PHIS]++;
} }
} else if (!is_Proj(irn)) { } else if (be_is_Perm(irn)) {
arch_irn_class_t classify = arch_irn_classify(irn); (*stats)[BE_STAT_PERMS]++;
} else if (be_is_Copy(irn)) {
if (classify & arch_irn_class_spill) (*stats)[BE_STAT_COPIES]++;
(*stats)[BE_STAT_SPILLS]++;
if (classify & arch_irn_class_reload)
(*stats)[BE_STAT_RELOADS]++;
if (classify & arch_irn_class_remat)
(*stats)[BE_STAT_REMATS]++;
if (classify & arch_irn_class_copy)
(*stats)[BE_STAT_COPIES]++;
if (classify & arch_irn_class_perm)
(*stats)[BE_STAT_PERMS]++;
} }
} }
...@@ -205,9 +196,6 @@ static const char *get_stat_name(enum be_stat_tag_t tag) ...@@ -205,9 +196,6 @@ static const char *get_stat_name(enum be_stat_tag_t tag)
case BE_STAT_MEM_PHIS: return "mem_phis"; case BE_STAT_MEM_PHIS: return "mem_phis";
case BE_STAT_COPIES: return "copies"; case BE_STAT_COPIES: return "copies";
case BE_STAT_PERMS: return "perms"; case BE_STAT_PERMS: return "perms";
case BE_STAT_SPILLS: return "spills";
case BE_STAT_RELOADS: return "reloads";
case BE_STAT_REMATS: return "remats";
default: panic("unknown stat tag found"); default: panic("unknown stat tag found");
} }
} }
......
...@@ -38,9 +38,6 @@ typedef enum be_stat_tag_t { ...@@ -38,9 +38,6 @@ typedef enum be_stat_tag_t {
BE_STAT_MEM_PHIS, /**< memory-phi count */ BE_STAT_MEM_PHIS, /**< memory-phi count */
BE_STAT_COPIES, /**< copies */ BE_STAT_COPIES, /**< copies */
BE_STAT_PERMS, /**< perms */ BE_STAT_PERMS, /**< perms */
BE_STAT_SPILLS, /**< spills (also folded spills) */
BE_STAT_RELOADS, /**< reloads (also folded reloads) */
BE_STAT_REMATS, /**< rematerialized nodes */
BE_STAT_COUNT BE_STAT_COUNT
} be_stat_tag_t; } be_stat_tag_t;
ENUM_COUNTABLE(be_stat_tag_t) ENUM_COUNTABLE(be_stat_tag_t)
......
...@@ -492,7 +492,7 @@ static void collect_spills_walker(ir_node *node, void *data) ...@@ -492,7 +492,7 @@ static void collect_spills_walker(ir_node *node, void *data)
{ {
be_verify_spillslots_env_t *env = (be_verify_spillslots_env_t*)data; be_verify_spillslots_env_t *env = (be_verify_spillslots_env_t*)data;
if (arch_irn_classify(node) & arch_irn_class_reload) { if (be_is_Reload(node)) {
ir_node *spill = get_memory_edge(node); ir_node *spill = get_memory_edge(node);
ir_entity *ent; ir_entity *ent;
...@@ -555,7 +555,7 @@ static void check_lonely_spills(ir_node *node, void *data) ...@@ -555,7 +555,7 @@ static void check_lonely_spills(ir_node *node, void *data)
} }
if (spill == NULL) { if (spill == NULL) {
ir_fprintf(stderr, "Verify warning: Node %+F in block %+F(%s) not connected to a reaload\n", ir_fprintf(stderr, "Verify warning: Node %+F in block %+F(%s) not connected to a reload\n",
node, get_nodes_block(node), get_irg_dump_name(env->irg)); node, get_nodes_block(node), get_irg_dump_name(env->irg));
} }
} }
......
...@@ -191,24 +191,6 @@ static ir_node *ia32_get_admissible_noreg(ir_node *irn, int pos) ...@@ -191,24 +191,6 @@ static ir_node *ia32_get_admissible_noreg(ir_node *irn, int pos)
} }
} }
static arch_irn_class_t ia32_classify(const ir_node *irn)
{
arch_irn_class_t classification = arch_irn_class_none;
assert(is_ia32_irn(irn));
if (is_ia32_is_reload(irn))
classification |= arch_irn_class_reload;
if (is_ia32_is_spill(irn))
classification |= arch_irn_class_spill;
if (is_ia32_is_remat(irn))
classification |= arch_irn_class_remat;
return classification;
}
/** /**
* The IA32 ABI callback object. * The IA32 ABI callback object.
*/ */
...@@ -633,7 +615,6 @@ static const be_abi_callbacks_t ia32_abi_callbacks = { ...@@ -633,7 +615,6 @@ static const be_abi_callbacks_t ia32_abi_callbacks = {
/* register allocator interface */ /* register allocator interface */
static const arch_irn_ops_t ia32_irn_ops = { static const arch_irn_ops_t ia32_irn_ops = {
ia32_classify,
ia32_get_frame_entity, ia32_get_frame_entity,
ia32_set_frame_offset, ia32_set_frame_offset,
ia32_get_sp_bias, ia32_get_sp_bias,
......
...@@ -73,12 +73,6 @@ ...@@ -73,12 +73,6 @@
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
static arch_irn_class_t sparc_classify(const ir_node *node)
{
(void) node;
return arch_irn_class_none;
}
static ir_entity *sparc_get_frame_entity(const ir_node *node) static ir_entity *sparc_get_frame_entity(const ir_node *node)
{ {
if (is_sparc_FrameAddr(node)) { if (is_sparc_FrameAddr(node)) {
...@@ -128,7 +122,6 @@ static int sparc_get_sp_bias(const ir_node *node) ...@@ -128,7 +122,6 @@ static int sparc_get_sp_bias(const ir_node *node)
/* fill register allocator interface */ /* fill register allocator interface */
const arch_irn_ops_t sparc_irn_ops = { const arch_irn_ops_t sparc_irn_ops = {
sparc_classify,
sparc_get_frame_entity, sparc_get_frame_entity,
sparc_set_frame_offset, sparc_set_frame_offset,
sparc_get_sp_bias, sparc_get_sp_bias,
......
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