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

be: Provide a default implementation for the hook 'is_valid_clobber()'.

In particular remove the unnecessary 'sparc_is_valid_clobber()'.
The wrapper 'be_is_valid_clobber()' already handles 'memory' and 'cc'.
parent 670c690e
......@@ -156,12 +156,6 @@ static const backend_params *TEMPLATE_get_backend_params(void)
return &p;
}
static int TEMPLATE_is_valid_clobber(const char *clobber)
{
(void)clobber;
return false;
}
static unsigned TEMPLATE_get_op_estimated_cost(const ir_node *node)
{
if (is_TEMPLATE_Load(node))
......@@ -181,7 +175,7 @@ static arch_isa_if_t const TEMPLATE_isa_if = {
.get_params = TEMPLATE_get_backend_params,
.generate_code = TEMPLATE_generate_code,
.lower_for_target = TEMPLATE_lower_for_target,
.is_valid_clobber = TEMPLATE_is_valid_clobber,
.is_valid_clobber = be_default_is_valid_clobber,
.get_op_estimated_cost = TEMPLATE_get_op_estimated_cost,
};
......
......@@ -214,12 +214,6 @@ static int arm_is_mux_allowed(ir_node *sel, ir_node *mux_false,
return false;
}
static int arm_is_valid_clobber(const char *clobber)
{
(void)clobber;
return false;
}
static void arm_lower_for_target(void)
{
/* lower compound param handling */
......@@ -326,7 +320,7 @@ static arch_isa_if_t const arm_isa_if = {
.get_params = arm_get_libfirm_params,
.generate_code = arm_generate_code,
.lower_for_target = arm_lower_for_target,
.is_valid_clobber = arm_is_valid_clobber,
.is_valid_clobber = be_default_is_valid_clobber,
.handle_intrinsics = arm_handle_intrinsics,
.get_op_estimated_cost = arm_get_op_estimated_cost,
};
......
......@@ -146,6 +146,12 @@ void arch_copy_irn_out_info(ir_node *const dst, unsigned const dst_pos, ir_node
*dst_info = *src_info;
}
int be_default_is_valid_clobber(char const *const clobber)
{
(void)clobber;
return false;
}
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch)
void be_init_arch(void)
{
......
......@@ -383,4 +383,6 @@ bool arch_reg_is_allocatable(const arch_register_req_t *req,
void arch_copy_irn_out_info(ir_node *dst, unsigned dst_pos, ir_node const *src);
int be_default_is_valid_clobber(char const *clobber);
#endif
......@@ -584,7 +584,7 @@ static arch_isa_if_t const sparc_isa_if = {
.generate_code = sparc_generate_code,
.get_params = sparc_get_backend_params,
.lower_for_target = sparc_lower_for_target,
.is_valid_clobber = sparc_is_valid_clobber,
.is_valid_clobber = be_default_is_valid_clobber,
.handle_intrinsics = sparc_handle_intrinsics,
.get_op_estimated_cost = sparc_get_op_estimated_cost,
};
......
......@@ -245,11 +245,6 @@ void sparc_init_asm_constraints(void)
* at the moment. see gcc/config/sparc/constraints.md */
}
int sparc_is_valid_clobber(const char *clobber)
{
return strcmp(clobber, "memory") == 0 || strcmp(clobber, "cc") == 0;
}
static bool sparc_check_immediate_constraint(long const val, char const imm_type)
{
switch (imm_type) {
......
......@@ -17,8 +17,6 @@ void sparc_transform_graph(ir_graph *irg);
void sparc_init_asm_constraints(void);
int sparc_is_valid_clobber(const char *clobber);
ir_node *create_ldf(dbg_info *dbgi, ir_node *block, ir_node *ptr,
ir_node *mem, ir_mode *mode, ir_entity *entity,
long offset, bool is_frame_entity);
......
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