summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2022-11-20 21:36:51 +0100
committerQuentin Carbonneaux <quentin@c9x.me>2022-11-20 21:44:25 +0100
commit1f696fed0dd9f9019209f3f8178f599d1e25c782 (patch)
tree38fc007b260d360a7ab41da693fd8c60bafb1572
parent0d50ebaed94f595961d88544a028bf7f523d3eac (diff)
downloadroux-1f696fed0dd9f9019209f3f8178f599d1e25c782.tar.gz
make Alias.base an int
We had the invariant that it'd
always be a temporary.
-rw-r--r--alias.c8
-rw-r--r--all.h2
-rw-r--r--load.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/alias.c b/alias.c
index b4bb0fb..3fd7d83 100644
--- a/alias.c
+++ b/alias.c
@@ -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) {
diff --git a/all.h b/all.h
index 881bdd5..4c3c35f 100644
--- a/all.h
+++ b/all.h
@@ -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;
diff --git a/load.c b/load.c
index 5a96d35..01718c0 100644
--- a/load.c
+++ b/load.c
@@ -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;
 	}