From 8cea6c2e91641b06921b4e358c73c60981ba366d Mon Sep 17 00:00:00 2001 From: lemon Date: Tue, 20 Jun 2023 19:11:15 +0200 Subject: add basic mem2reg promotes uniform stack slots to temporaries currently only for immutable variables, next thing to implement is ssa construction --- ir.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ir.h') diff --git a/ir.h b/ir.h index 8208dea..e34cb6a 100644 --- a/ir.h +++ b/ir.h @@ -113,6 +113,12 @@ struct instr { union ref l, r; }; +struct use { bool isjmp; union { ushort ins, blk; }; }; +struct uses { + int nuse; + struct use *use, _use0[2]; +}; + enum jumpkind { JXXX, Jb, Jret, }; @@ -235,9 +241,13 @@ void replref(struct function *, struct block *, int, union ref from, union ref t void irdump(struct function *); -void lowerintrin(struct function *); +struct uses *ssauses(struct function *); +void freeuses(struct uses *, int n); + void abi0(struct function *); void abi0_call(struct function *, struct instr *, struct block *blk, int *curi); +void mem2reg(struct function *); +void lowerintrin(struct function *); void regalloc(struct function *); /* vim:set ts=3 sw=3 expandtab: */ -- cgit v1.2.3