Commit 2c077dd1 authored by Matthias Braun's avatar Matthias Braun
Browse files

Add a way to specify additional register pressure for the first 4 register classes

I'm not proud of the 4 restriction but for now this works.
parent 1cf87be9
......@@ -17,6 +17,7 @@
#include "irnode_t.h"
#include "irop_t.h"
#include "raw_bitset.h"
#include "util.h"
arch_register_req_t const arch_no_requirement = {
.cls = NULL,
......@@ -85,6 +86,28 @@ arch_register_t const *arch_find_register(char const *const name)
return NULL;
}
void arch_set_additional_pressure(ir_node *const node,
arch_register_class_t const *const cls,
uint8_t const pressure)
{
backend_info_t *const info = be_get_info(node);
/* restricted to the first few classes for now */
unsigned index = cls->index;
assert(index < ARRAY_SIZE(info->add_pressure));
info->add_pressure[index] = pressure;
}
uint8_t arch_get_additional_pressure(ir_node const *const node,
arch_register_class_t const *const cls)
{
backend_info_t *const info = be_get_info(node);
/* restricted to the first few classes for now */
unsigned index = cls->index;
if (index < ARRAY_SIZE(info->add_pressure))
return info->add_pressure[index];
return 0;
}
void be_make_start_mem(be_start_info_t *const info, ir_node *const start, unsigned const pos)
{
info->pos = pos;
......
......@@ -120,6 +120,12 @@ static inline void arch_add_irn_flags(ir_node *const node, arch_irn_flags_t cons
info->flags |= flags;
}
void arch_set_additional_pressure(ir_node *node, arch_register_class_t const *,
uint8_t pressure);
uint8_t arch_get_additional_pressure(ir_node const *node,
arch_register_class_t const *cls);
/**
* Returns true if the given node should not be scheduled (has
* arch_irn_flag_not_scheduled flag set)
......
......@@ -33,6 +33,8 @@ struct reg_out_info_t {
struct backend_info_t {
sched_info_t sched_info;
/** Additional register pressure for the fist 4 regclasses */
uint8_t add_pressure[4];
const arch_register_req_t **in_reqs;
reg_out_info_t *out_infos;
arch_irn_flags_t flags;
......
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