diff options
| author | 2025-09-15 17:11:05 +0200 | |
|---|---|---|
| committer | 2025-09-15 17:11:46 +0200 | |
| commit | b8ae5b14c7bbe28161ea83f4c10045f8af5b766a (patch) | |
| tree | b53e99abf48f82435220aecea86c5569b85a74e6 /ir.c | |
| parent | bdf9776b0b127b53a34be07f8adc0541df78654e (diff) | |
mem2reg: fix deltrivialphis bug
Diffstat (limited to 'ir.c')
| -rw-r--r-- | ir.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -288,7 +288,7 @@ newinstr(void) assert(ninstr < arraylength(instrtab)); t = ninstr++; } - if (instrnuse[t] > arraylength(*instrusebuf)) + if (instruse[t] != instrusebuf[t]) xbfree(instruse[t]); instruse[t] = instrusebuf[t]; instrnuse[t] = 0; @@ -298,8 +298,9 @@ newinstr(void) void adduse(struct block *ublk, int ui, union ref r) { struct use user = { ublk, ui }; + if (r.t != RTMP) return; - if (instrnuse[r.i] < arraylength(*instrusebuf)) { + if (instrnuse[r.i] < arraylength(instrusebuf[r.i])) { instruse[r.i][instrnuse[r.i]++] = user; } else if (instrnuse[r.i] == arraylength(*instrusebuf)) { struct use *use = NULL; @@ -416,8 +417,10 @@ replcuses(union ref from, union ref to) void deluses(int ins) { - if (instrnuse[ins] > 2) + if (instruse[ins] != instrusebuf[ins]) { xbfree(instruse[ins]); + instruse[ins] = instrusebuf[ins]; + } instrnuse[ins] = 0; } |