Commit 044ec2b3 authored by Matthias Braun's avatar Matthias Braun
Browse files

sparc: no need for is_load_store attribute anymore

[r27949]
parent 2e451cd6
......@@ -74,14 +74,12 @@ static arch_irn_class_t sparc_classify(const ir_node *irn)
static ir_entity *sparc_get_frame_entity(const ir_node *irn)
{
const sparc_attr_t *attr = get_sparc_attr_const(irn);
if (is_sparc_FrameAddr(irn)) {
const sparc_symconst_attr_t *attr = get_irn_generic_attr_const(irn);
return attr->entity;
}
if (attr->is_load_store) {
if (sparc_has_load_store_attr(irn)) {
const sparc_load_store_attr_t *load_store_attr = get_sparc_load_store_attr_const(irn);
if (load_store_attr->is_frame_entity) {
return load_store_attr->entity;
......@@ -102,7 +100,7 @@ static void sparc_set_frame_offset(ir_node *irn, int offset)
attr->fp_offset += offset;
} else {
sparc_load_store_attr_t *attr = get_sparc_load_store_attr(irn);
assert(attr->base.is_load_store);
assert(sparc_has_load_store_attr(irn));
attr->offset += offset;
}
}
......
......@@ -49,7 +49,7 @@ static bool has_symconst_attr(const ir_node *node)
return is_sparc_SymConst(node) || is_sparc_FrameAddr(node);
}
static bool has_load_store_attr(const ir_node *node)
bool sparc_has_load_store_attr(const ir_node *node)
{
return is_sparc_Ld(node) || is_sparc_St(node) || is_sparc_Ldf(node)
|| is_sparc_Stf(node);
......@@ -110,7 +110,7 @@ static void sparc_dump_node(FILE *F, ir_node *n, dump_reason_t reason)
ir_fprintf(F, "entity: %+F\n", attr->entity);
fprintf(F, "fp_offset: %d\n", attr->fp_offset);
}
if (has_load_store_attr(n)) {
if (sparc_has_load_store_attr(n)) {
const sparc_load_store_attr_t *attr = get_sparc_load_store_attr_const(n);
ir_fprintf(F, "load store mode: %+F\n", attr->load_store_mode);
ir_fprintf(F, "entity: (sign %d) %+F\n", attr->entity_sign,
......@@ -200,13 +200,13 @@ const sparc_attr_t *get_sparc_attr_const(const ir_node *node)
sparc_load_store_attr_t *get_sparc_load_store_attr(ir_node *node)
{
assert(has_load_store_attr(node));
assert(sparc_has_load_store_attr(node));
return (sparc_load_store_attr_t*) get_irn_generic_attr_const(node);
}
const sparc_load_store_attr_t *get_sparc_load_store_attr_const(const ir_node *node)
{
assert(has_load_store_attr(node));
assert(sparc_has_load_store_attr(node));
return (const sparc_load_store_attr_t*) get_irn_generic_attr_const(node);
}
......@@ -330,8 +330,7 @@ static void init_sparc_attributes(ir_node *node, arch_irn_flags_t flags,
(void) execution_units;
arch_irn_set_flags(node, flags);
attr->in_req = in_reqs;
attr->is_load_store = false;
attr->in_req = in_reqs;
info = be_get_info(node);
info->out_infos = NEW_ARR_D(reg_out_info_t, obst, n_res);
......@@ -349,7 +348,6 @@ static void init_sparc_load_store_attributes(ir_node *res, ir_mode *ls_mode,
attr->entity_sign = entity_sign;
attr->is_frame_entity = is_frame_entity;
attr->offset = offset;
attr->base.is_load_store = true;
}
static void init_sparc_symconst_attributes(ir_node *res, ir_entity *entity)
......@@ -407,7 +405,7 @@ static int cmp_attr_sparc(ir_node *a, ir_node *b)
const sparc_attr_t *attr_b = get_sparc_attr_const(b);
return attr_a->immediate_value != attr_b->immediate_value
|| attr_a->is_load_store != attr_b->is_load_store;
|| attr_a->immediate_value_entity != attr_b->immediate_value_entity;
}
static int cmp_attr_sparc_load_store(ir_node *a, ir_node *b)
......
......@@ -25,6 +25,7 @@
#ifndef FIRM_BE_SPARC_SPARC_NEW_NODES_H
#define FIRM_BE_SPARC_SPARC_NEW_NODES_H
#include <stdbool.h>
#include "sparc_nodes_attr.h"
/**
......@@ -33,6 +34,7 @@
sparc_attr_t *get_sparc_attr(ir_node *node);
const sparc_attr_t *get_sparc_attr_const(const ir_node *node);
bool sparc_has_load_store_attr(const ir_node *node);
sparc_load_store_attr_t *get_sparc_load_store_attr(ir_node *node);
const sparc_load_store_attr_t *get_sparc_load_store_attr_const(const ir_node *node);
......
......@@ -38,8 +38,6 @@ struct sparc_attr_t
except_attr exc; /**< the exception attribute. MUST be the first one. */
const arch_register_req_t **in_req; /**< register requirements for arguments */
int32_t immediate_value; /* immediate values */
bool is_load_store;
ir_entity *immediate_value_entity; /* hack for now */
};
......
Supports Markdown
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