Commit a77befc1 authored by Matthias Braun's avatar Matthias Braun
Browse files

amd64: Remove needs_frame_ent field

We can see that we need a frame entity if the the immediate has a
X86_IMM_FRAMEOFFSET relocation but no entity assigned yet.
parent a020b3f3
......@@ -214,8 +214,7 @@ static int amd64_addr_attrs_equal(const ir_node *a, const ir_node *b)
const amd64_addr_attr_t *attr_b = get_amd64_addr_attr_const(b);
return amd64_attrs_equal(a, b)
&& amd64_addrs_equal(&attr_a->addr, &attr_b->addr)
&& attr_a->insn_mode == attr_b->insn_mode
&& attr_a->needs_frame_ent == attr_b->needs_frame_ent;
&& attr_a->insn_mode == attr_b->insn_mode;
}
static int amd64_binop_addr_attrs_equal(const ir_node *a,
......
......@@ -82,8 +82,7 @@ typedef struct {
typedef struct {
amd64_attr_t base;
bool needs_frame_ent : 1;
ENUMBF(amd64_insn_mode_t) insn_mode : 3;
ENUMBF(amd64_insn_mode_t) insn_mode : 3;
amd64_addr_t addr;
} amd64_addr_attr_t;
......
......@@ -1688,9 +1688,8 @@ no_call_mem:
.base = {
.op_mode = op_mode,
},
.needs_frame_ent = false,
.insn_mode = INSN_MODE_64,
.addr = addr,
.insn_mode = INSN_MODE_64,
.addr = addr,
},
.call_tp = type,
};
......@@ -2151,14 +2150,14 @@ ir_node *amd64_new_spill(ir_node *value, ir_node *after)
amd64_binop_addr_attr_t attr;
memset(&attr, 0, sizeof(attr));
attr.base.base.op_mode = AMD64_OP_ADDR_REG;
attr.base.insn_mode = INSN_MODE_64;
attr.base.needs_frame_ent = true;
attr.base.base.op_mode = AMD64_OP_ADDR_REG;
attr.base.insn_mode = INSN_MODE_64;
amd64_addr_t *addr = &attr.base.addr;
addr->base_input = 1;
addr->index_input = NO_INPUT;
ir_node *in[] = { value, frame, mem };
addr->immediate.kind = X86_IMM_FRAMEOFFSET;
addr->base_input = 1;
addr->index_input = NO_INPUT;
ir_node *in[] = { value, frame, mem };
ir_node *store;
if (mode_is_float(mode) || mode == amd64_mode_xmm) {
......@@ -2201,7 +2200,7 @@ ir_node *amd64_new_reload(ir_node *value, ir_node *spill, ir_node *before)
arch_add_irn_flags(load, arch_irn_flag_reload);
sched_add_before(before, load);
amd64_addr_attr_t *attr = get_amd64_addr_attr(load);
attr->needs_frame_ent = true;
attr->addr.immediate.kind = X86_IMM_FRAMEOFFSET;
return be_new_Proj(load, pn_res);
}
......
......@@ -479,8 +479,9 @@ static void amd64_collect_frame_entity_nodes(ir_node *node, void *data)
return;
const amd64_addr_attr_t *attr = get_amd64_addr_attr_const(node);
if (attr->needs_frame_ent) {
/* TODO: improve this */
x86_imm32_t const *imm = &attr->addr.immediate;
if (imm->kind == X86_IMM_FRAMEOFFSET && imm->entity == NULL) {
/* TODO: do not hardcode node names here */
const ir_mode *mode = is_amd64_movdqu(node) ? amd64_mode_xmm
: mode_Lu;
const ir_type *type = get_type_for_mode(mode);
......
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