summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bearch.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2015-07-23 07:17:03 +0200
committerMatthias Braun <matze@braunis.de>2015-07-23 07:21:28 +0200
commit2c077dd1b15e9ab04a2421794f987e83dafa829a (patch)
treed958be52de12ce0c4f3e40a46aaabdf88fcd5b79 /ir/be/bearch.c
parent1cf87be91d21eb4d86d9c04a4575c78b830cb66e (diff)
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.
Diffstat (limited to 'ir/be/bearch.c')
-rw-r--r--ir/be/bearch.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/ir/be/bearch.c b/ir/be/bearch.c
index 56d7544..9cded6e 100644
--- a/ir/be/bearch.c
+++ b/ir/be/bearch.c
@@ -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;