aboutsummaryrefslogtreecommitdiff
path: root/src/nodes.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-04-03 18:36:21 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-04-03 18:36:21 +0300
commitf4be2429f38faba0c54862055f808cb242a7eb49 (patch)
tree84f03075952f2c22ccf774646168a08b2f47b8c6 /src/nodes.c
parent36de4f902c4eec9f8d918e00cf0bf89d6b670cf5 (diff)
downloadqbt-f4be2429f38faba0c54862055f808cb242a7eb49.tar.gz
qbt-f4be2429f38faba0c54862055f808cb242a7eb49.zip
make regalloc work with ssa form
+ Still not ideal register allocator, but can be improved with some heuristics and potentially completely replaced in the future if so desired with graph coloring or something.
Diffstat (limited to 'src/nodes.c')
-rw-r--r--src/nodes.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nodes.c b/src/nodes.c
index a6ff0b8..05f96fe 100644
--- a/src/nodes.c
+++ b/src/nodes.c
@@ -6,7 +6,8 @@
#include <qbt/debug.h>
#include <qbt/vec.h>
-void insadd(struct blk *b, enum insn_type o, enum val_type t, struct val r, struct val a0, struct val a1)
+void insadd(struct blk *b, enum insn_type o, enum val_type t, struct val r,
+ struct val a0, struct val a1)
{
struct insn i = insn_create(o, t, r, a0, a1);
vec_append(&b->insns, &i);
@@ -35,7 +36,8 @@ int64_t idmatch(struct fn *f, const char *id)
return -1;
}
-void finish_block(struct blk *b, enum insn_type cmp, struct val a0, struct val a1, const char *label)
+void finish_block(struct blk *b, enum insn_type cmp, struct val a0,
+ struct val a1, const char *label)
{
assert(cmp >= BEQ && cmp <= RET && "illegal comparison type for block");
b->btype = cmp;
@@ -198,7 +200,7 @@ void dump_block(struct blk *b)
{
printf("//\t/*** block %lld ", (long long)b->id);
if (b->name) printf("\"%s\" ", b->name);
-
+
printf("(");
foreach_blk_param(pi, b->params) {
struct val v = blk_param_at(b->params, pi);