diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-03 18:36:21 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-03 18:36:21 +0300 |
| commit | f4be2429f38faba0c54862055f808cb242a7eb49 (patch) | |
| tree | 84f03075952f2c22ccf774646168a08b2f47b8c6 /src/abi.c | |
| parent | 36de4f902c4eec9f8d918e00cf0bf89d6b670cf5 (diff) | |
| download | qbt-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/abi.c')
| -rw-r--r-- | src/abi.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -19,7 +19,7 @@ static struct insn rewrite_param(struct insn n) assert(n.in[1].class == IMM); int64_t nth_param = n.in[1].v; assert(nth_param >= 0 && nth_param < 25 - && "stack argument passing not yet supported"); + && "stack argument passing not yet supported"); return insn_create(MOVE, I27, n.out, nth_ar(nth_param), noclass()); } @@ -41,9 +41,11 @@ static struct insn rewrite_arg(struct insn n) assert(nth_arg >= 0 && nth_arg < 25); if (n.in[0].class == TMP || n.in[0].class == REG) - return insn_create(MOVE, I27, nth_ar(nth_arg), n.in[0], noclass()); + return insn_create(MOVE, I27, nth_ar(nth_arg), n.in[0], + noclass()); else if (n.in[0].class == IMM || n.in[0].class == REF) - return insn_create(COPY, I27, nth_ar(nth_arg), n.in[0], noclass()); + return insn_create(COPY, I27, nth_ar(nth_arg), n.in[0], + noclass()); assert("illegal arg type"); abort(); @@ -57,9 +59,11 @@ static struct insn rewrite_retarg(struct insn n) assert(nth_arg >= 0 && nth_arg < 25); if (n.in[0].class == TMP || n.in[0].class == REG) - return insn_create(MOVE, I27, nth_ar(nth_arg), n.in[0], noclass()); + return insn_create(MOVE, I27, nth_ar(nth_arg), n.in[0], + noclass()); else if (n.in[0].class == IMM || n.in[0].class == REF) - return insn_create(COPY, I27, nth_ar(nth_arg), n.in[0], noclass()); + return insn_create(COPY, I27, nth_ar(nth_arg), n.in[0], + noclass()); assert("illegal retval type"); abort(); |
