dillon1000/react

Commit

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.
Browse files
Changed paths4 files
First-parent comparison
M compiler/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 Renamed
Patch

Files changed

Rendering syntax-highlighted changes…