diff options
| author | Quentin Carbonneaux <[email protected]> | 2022-11-20 21:36:51 +0100 |
|---|---|---|
| committer | Quentin Carbonneaux <[email protected]> | 2022-11-20 21:44:25 +0100 |
| commit | 1f696fed0dd9f9019209f3f8178f599d1e25c782 (patch) | |
| tree | 38fc007b260d360a7ab41da693fd8c60bafb1572 | |
| parent | 0d50ebaed94f595961d88544a028bf7f523d3eac (diff) | |
make Alias.base an int
We had the invariant that it'd
always be a temporary.
| -rw-r--r-- | alias.c | 8 | ||||
| -rw-r--r-- | all.h | 2 | ||||
| -rw-r--r-- | load.c | 4 |
3 files changed, 7 insertions, 7 deletions
@@ -43,7 +43,7 @@ alias(Ref p, int sp, Ref q, int sq, int *delta, Fn *fn) /* if both are offsets of the same * stack slot, they alias iif they * overlap */ - if (req(ap.base, aq.base) && ovlap) + if (ap.base == aq.base && ovlap) return MustAlias; return NoAlias; } @@ -60,7 +60,7 @@ alias(Ref p, int sp, Ref q, int sq, int *delta, Fn *fn) } if ((ap.type == ACon && aq.type == ACon) - || (ap.type == aq.type && req(ap.base, aq.base))) { + || (ap.type == aq.type && ap.base == aq.base)) { assert(ap.type == ACon || ap.type == AUnk); /* if they have the same base, we * can rely on the offsets only */ @@ -122,7 +122,7 @@ fillalias(Fn *fn) a = &fn->tmp[p->to.val].alias; assert(a->type == ABot); a->type = AUnk; - a->base = p->to; + a->base = p->to.val; a->offset = 0; a->slot = 0; } @@ -139,7 +139,7 @@ fillalias(Fn *fn) a->type = AUnk; a->slot = 0; } - a->base = i->to; + a->base = i->to.val; a->offset = 0; } if (i->op == Ocopy) { @@ -280,7 +280,7 @@ struct Alias { AUnk = 6, #define astack(t) ((t) & 1) } type; - Ref base; + int base; uint32_t label; int64_t offset; int reloc; @@ -144,7 +144,7 @@ load(Slice sl, bits msk, Loc *l) case ALoc: case AEsc: case AUnk: - r = a->base; + r = TMP(a->base); if (!a->offset) break; r1 = getcon(a->offset, curf); @@ -178,7 +178,7 @@ killsl(Ref r, Slice sl) default: die("unreachable"); case ALoc: case AEsc: - case AUnk: return req(a->base, r); + case AUnk: return req(TMP(a->base), r); case ACon: case ASym: return 0; } |
