dillon1000/react
Commit
Browse files Fix EliminateRedundantPhi for cascading eliminated phis
This was the actual bug. When EliminateRedundantPhis eliminates a phi, it has to rewrite downstream usages of the phi id to the single operand id. We were correctly doing that in all but one place. When we iterate _downstream phis_, we were looking up the operands against the rewrite table, but not updating the phi operands themselves to the rewritten value. This fixes the bug, and incidentally fixes a test that has been broken for a while and nagging at me.
Changed paths4 files
First-parent comparisoncompiler/forget/src/SSA/EliminateRedundantPhi.ts ModifiedM compiler/forget/src/__tests__/fixtures/hir/for-logical.expect.md ModifiedR compiler/forget/src/__tests__/fixtures/hir/_bug.ssa.expect.md →compiler/forget/src/__tests__/fixtures/hir/ssa-cascading-eliminated-phis.expect.md RenamedR compiler/forget/src/__tests__/fixtures/hir/_bug.ssa.js →compiler/forget/src/__tests__/fixtures/hir/ssa-cascading-eliminated-phis.js RenamedPatch
Files changed
Rendering syntax-highlighted changes…