aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir.h
diff options
context:
space:
mode:
author lemon<lsof@mailbox.org>2025-09-08 22:05:33 +0200
committer lemon<lsof@mailbox.org>2025-09-08 22:05:33 +0200
commite043811980db560fc2507bb53b644e54c80527dc (patch)
tree6ea563d81c9d3767f439e361fc2c884cf4f9b64d /ir.h
parent36b5b19bf183cb01525201ccbddd6afa692f21bb (diff)
regalloc: start implementing linear scan
Diffstat (limited to 'ir.h')
-rw-r--r--ir.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/ir.h b/ir.h
index f67a5f7..eb31542 100644
--- a/ir.h
+++ b/ir.h
@@ -90,6 +90,7 @@ enum op {
#define oisstore(o) in_range(o, Ostore1, Ostore8)
#define oisload(o) in_range(o, Oloads1, Oloadf8)
extern const char *opnames[];
+extern const uchar opnarg[];
enum intrin {
INxxx,
@@ -105,7 +106,7 @@ struct instr {
keep : 1; /* for codegen, keep instr even if result seems unused */
uchar inplace : 1; /* set (by isel) for instructions which modify its first arg in place */
uchar reg; /* 0 -> no reg; else reg + 1 */
- union ref l, r;
+ union ref l, r; /* args */
};
enum jumpkind { JXXX, Jb, Jret, };
@@ -114,6 +115,7 @@ struct block {
int id;
int npred;
int visit;
+ int inumstart;
union {
struct block *_pred0;
struct block **_pred;
@@ -239,6 +241,7 @@ void fillblkids(struct function *);
#define startbbvisit() (void)(++visitmark)
#define wasvisited(blk) ((blk)->visit == visitmark)
#define markvisited(blk) ((blk)->visit = visitmark)
+void numberinstrs(struct function *);
/* IR builder functions */
union ref addinstr(struct function *, struct instr);