EnterSSA traverses function expressions

This commit is contained in:
Joe Savona
2023-06-08 14:02:02 -04:00
parent c2c221a452
commit 638e45c928
2 changed files with 5 additions and 2 deletions
@@ -17,7 +17,7 @@ import {
ReactiveScopeDependency,
} from "../HIR";
import { constantPropagation } from "../Optimization";
import { eliminateRedundantPhi, enterSSA } from "../SSA";
import { eliminateRedundantPhi } from "../SSA";
import { inferTypes } from "../TypeInference";
import { logHIRFunction } from "../Utils/logger";
import { inferMutableRanges } from "./InferMutableRanges";
@@ -89,7 +89,6 @@ export default function analyseFunctions(func: HIRFunction): void {
}
function lower(func: HIRFunction): void {
enterSSA(func);
eliminateRedundantPhi(func);
constantPropagation(func);
inferTypes(func);
@@ -232,6 +232,10 @@ export default function enterSSA(func: HIRFunction): void {
for (const instr of block.instructions) {
mapInstructionLValues(instr, (lvalue) => builder.definePlace(lvalue));
mapInstructionOperands(instr, (place) => builder.getPlace(place));
if (instr.value.kind === "FunctionExpression") {
enterSSA(instr.value.loweredFunc);
}
}
mapTerminalOperands(block.terminal, (place) => builder.getPlace(place));