Commit c59fdbff authored by Christoph Mallon's avatar Christoph Mallon
Browse files

be: Remove arch_possible_memory_operand().

Just do the check in the corresponding implementation of arch_perform_memory_operand().
parent 7fa631ea
......@@ -56,21 +56,11 @@ int arch_get_sp_bias(ir_node *irn)
return ops->get_sp_bias(irn);
}
int arch_possible_memory_operand(const ir_node *irn, unsigned int i)
{
const arch_irn_ops_t *ops = get_irn_ops(irn);
if (ops->possible_memory_operand) {
return ops->possible_memory_operand(irn, i);
} else {
return 0;
}
}
void arch_perform_memory_operand(ir_node *irn, unsigned int i)
{
const arch_irn_ops_t *ops = get_irn_ops(irn);
ops->perform_memory_operand(irn, i);
if (ops->perform_memory_operand)
ops->perform_memory_operand(irn, i);
}
int arch_get_op_estimated_cost(const ir_node *irn)
......
......@@ -79,8 +79,6 @@ int arch_get_sp_bias(ir_node *irn);
int arch_get_op_estimated_cost(const ir_node *irn);
int arch_possible_memory_operand(const ir_node *irn, unsigned i);
void arch_perform_memory_operand(ir_node *irn, unsigned i);
/**
......@@ -347,17 +345,6 @@ struct arch_irn_ops_t {
*/
int (*get_op_estimated_cost)(const ir_node *irn);
/**
* Asks the backend whether operand @p i of @p irn can be loaded form memory
* internally
*
* @param irn The node.
* @param i Index of the argument we would like to know whether @p irn
* can load it form memory internally
* @return nonzero if argument can be loaded or zero otherwise
*/
int (*possible_memory_operand)(const ir_node *irn, unsigned i);
/**
* Ask the backend to assimilate @p reload of operand @p i into @p irn.
*
......
......@@ -153,9 +153,7 @@ static void memory_operand_walker(ir_node *irn, void *env)
/* only use memory operands, if the reload is only used by 1 node */
if (get_irn_n_edges(in) > 1)
continue;
if (arch_possible_memory_operand(irn, i)) {
arch_perform_memory_operand(irn, i);
}
arch_perform_memory_operand(irn, i);
}
}
......
......@@ -625,7 +625,6 @@ static const arch_irn_ops_t phi_irn_ops = {
dummy_set_frame_offset,
dummy_get_sp_bias,
NULL, /* get_op_estimated_cost */
NULL, /* possible_memory_operand */
NULL, /* perform_memory_operand */
};
......
......@@ -309,9 +309,9 @@ static ir_mode *get_spill_mode(const ir_node *value)
* Check if irn can load its operand at position i from memory (source addressmode).
* @param irn The irn to be checked
* @param i The operands position
* @return Non-Zero if operand can be loaded
* @return whether operand can be loaded
*/
static int ia32_possible_memory_operand(const ir_node *irn, unsigned int i)
static bool ia32_possible_memory_operand(const ir_node *irn, unsigned int i)
{
if (!is_ia32_irn(irn) || /* must be an ia32 irn */
get_ia32_op_type(irn) != ia32_Normal || /* must not already be a addressmode irn */
......@@ -377,7 +377,8 @@ static int ia32_possible_memory_operand(const ir_node *irn, unsigned int i)
static void ia32_perform_memory_operand(ir_node *irn, unsigned int i)
{
assert(ia32_possible_memory_operand(irn, i));
if (!ia32_possible_memory_operand(irn, i))
return;
ir_node *op = get_irn_n(irn, i);
ir_node *load = get_Proj_pred(op);
......@@ -419,7 +420,6 @@ static const arch_irn_ops_t ia32_irn_ops = {
.set_frame_offset = ia32_set_frame_offset,
.get_sp_bias = ia32_get_sp_bias,
.get_op_estimated_cost = ia32_get_op_estimated_cost,
.possible_memory_operand = ia32_possible_memory_operand,
.perform_memory_operand = ia32_perform_memory_operand,
};
......
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