diff options
| author | 2023-06-20 19:52:35 +0200 | |
|---|---|---|
| committer | 2023-06-20 19:52:35 +0200 | |
| commit | 42c7551e508e45cd4346e67898c374b910ee1407 (patch) | |
| tree | 277adf9d6286803a9023c77b33e967525ea31c31 /regalloc.c | |
| parent | a0de0318bbb41e9d51375a273fdad033ddd0ae90 (diff) | |
improve codegen for div a little (bikeshedding)
Diffstat (limited to 'regalloc.c')
| -rw-r--r-- | regalloc.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -238,7 +238,8 @@ use(struct rega *ra, struct block *blk, int curi, enum op op, int hint, union re assert(ins->op != Ocall); if (ins->r.t == RREG && ins->inplace) excl |= 1ull<<ins->r.i; - if (hint == -1 && ins->op == Ocopy && ins->l.t == RREG) /* for '%x = copy Rx', hint %x to use Rx */ + if ((hint == -1 || ra->regs[hint].t) && ins->op == Ocopy && ins->l.t == RREG) + /* for '%x = copy Rx', hint %x to use Rx */ hint = ins->l.i; if (hint != -1 && !(excl >> hint & 1) && !ra->regs[hint].t) { take(ra, hint, *ref); |