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)
{
(void) node;
/* fill register allocator interface */
static const arch_irn_ops_t TEMPLATE_irn_ops = {
- TEMPLATE_classify,
TEMPLATE_get_frame_entity,
TEMPLATE_set_frame_offset,
TEMPLATE_get_sp_bias,
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)
{
if (is_amd64_FrameAddr(node)) {
/* fill register allocator interface */
static const arch_irn_ops_t amd64_irn_ops = {
- amd64_classify,
amd64_get_frame_entity,
amd64_set_frame_offset,
amd64_get_sp_bias,
#include "arm_emitter.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)
{
const arm_attr_t *attr = get_arm_attr_const(irn);
/* fill register allocator interface */
static const arch_irn_ops_t arm_irn_ops = {
- arm_classify,
arm_get_frame_entity,
arm_set_stack_bias,
arm_get_sp_bias,
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)
{
backend_info_t *info;
void arch_dump_register_reqs(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);
ir_entity *arch_get_frame_entity(const ir_node *irn);
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.
* @param isa The isa which shall be put into the environment.
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.
* @param irn The node in question.
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)
{
return be_get_frame_entity(irn);
/* for be nodes */
static const arch_irn_ops_t be_node_irn_ops = {
- be_node_classify,
be_node_get_frame_entity,
be_node_set_frame_offset,
be_node_get_sp_bias,
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)
{
(void) node;
/* for "middleend" nodes */
static const arch_irn_ops_t dummy_be_irn_ops = {
- dummy_classify,
dummy_get_frame_entity,
dummy_set_frame_offset,
dummy_get_sp_bias,
}
static const arch_irn_ops_t phi_irn_ops = {
- dummy_classify,
dummy_get_frame_entity,
dummy_set_frame_offset,
dummy_get_sp_bias,
} else {
(*stats)[BE_STAT_PHIS]++;
}
- } else if (!is_Proj(irn)) {
- arch_irn_class_t classify = arch_irn_classify(irn);
-
- if (classify & arch_irn_class_spill)
- (*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]++;
+ } else if (be_is_Perm(irn)) {
+ (*stats)[BE_STAT_PERMS]++;
+ } else if (be_is_Copy(irn)) {
+ (*stats)[BE_STAT_COPIES]++;
}
}
case BE_STAT_MEM_PHIS: return "mem_phis";
case BE_STAT_COPIES: return "copies";
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");
}
}
BE_STAT_MEM_PHIS, /**< memory-phi count */
BE_STAT_COPIES, /**< copies */
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_tag_t;
ENUM_COUNTABLE(be_stat_tag_t)
{
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_entity *ent;
}
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));
}
}
}
}
-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.
*/
/* register allocator interface */
static const arch_irn_ops_t ia32_irn_ops = {
- ia32_classify,
ia32_get_frame_entity,
ia32_set_frame_offset,
ia32_get_sp_bias,
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)
{
if (is_sparc_FrameAddr(node)) {
/* fill register allocator interface */
const arch_irn_ops_t sparc_irn_ops = {
- sparc_classify,
sparc_get_frame_entity,
sparc_set_frame_offset,
sparc_get_sp_bias,