[typer] Add type to Phi
Sathya Gunasekaran committed
Jan 11, 2023 at 11:30 UTC
0c3cfbdd3633632c1653161b02d32bdb14af7d92
3 files changed
+3
compiler/forget/src/HIR/HIR.ts
+1
@@ -280,6 +280,7 @@ export type Phi = {
280
kind: "Phi";
281
id: Identifier;
282
operands: Map<BlockId, Identifier>;
283
+ type: Type;
284
};
285
286
export type InstructionData =
compiler/forget/src/HIR/PrintHIR.ts
+1
@@ -112,6 +112,7 @@ function printPhi(phi: Phi): string {
112
const items = [];
113
items.push(printIdentifier(phi.id));
114
items.push(printMutableRange(phi.id));
115
+ items.push(printType(phi.type));
116
items.push(": phi(");
117
const phis = [];
118
for (const [blockId, id] of phi.operands) {
compiler/forget/src/SSA/EnterSSA.ts
+1
@@ -138,6 +138,7 @@ class SSABuilder {
138
kind: "Phi",
139
id: newId,
140
operands: predDefs,
141
+ type: makeType(),
142
};
143
144
block.phis.add(phi);