forked from nominolo/lambdachine
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finding cycles in heap nodes now seems to work correctly. Nodes that are updated should also be handled better. This work required a number of changes and refactorings, including: * We now emit PHI nodes for every unrolled instruction that is not completely loop invariant. Before, we didn't emit a PHI node for an instruction `i` if the `rename[i]` did occur before the LOOP marker. That was plain wrong. As a counter example see tests Bc/Jit000[1-3].hs * This leads to many PHI nodes being emitted initially, but DCE removes most of them. * PHI nodes are now also properly treated as parallel assignments in the IR interpreter. The codegen still needs updating. * When looking for cycles in heap nodes we now treat PHIs as separate nodes and don't try looking through them. This is needed because the second argument of a PHI node may be another PHI node. We can actually have full loops. * When a PHI node is updated, do not try to sink any of the nodes reachable from that PHI node. We're basically performing a write into values from a previous loop iteration, so we probably can't optimise that any better. * All tests but one are passing. The failing one, Bench/SumSquare1.hs, is failing due to GC occurring in the middle of the IR interpreter. The fix will be to use proper HEAPCHECK guard IR instructions. That'll come next.
- Loading branch information
Showing
11 changed files
with
852 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.