Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chapter 7 (also 8 but not officially) (SeaOfNodes#48)
* SeaOfNodes#44 Start on chapter 7 * SeaOfNodes#44 Temp hack on printing to not break on cycles. Parse while statement. * SeaOfNodes#44 Remove unnecessary method * SeaOfNodes#44 Remove unnecessary phi map * SeaOfNodes#44 Phi should have existing nodes from both scopes as input * SeaOfNodes#44 We need to only insert phis once for each name that is looked up. To do so, we need to know when a named is looked up first time inside the loop body. The phi must have its second input added later on after the loop is fully parsed. * SeaOfNodes#44 Add phi also when update() is called. Only add phi if name was known at loop start * SeaOfNodes#44 Only create phi in loop body if var binding in head != body. During finish() lookup in body directly. * SeaOfNodes#44 Update the print output to make it similar to that in Xmilia's fork * SeaOfNodes#44 Disable peephole for phis & region involved in while loop * Fix broken tests Remove "disablePeephole" set in some tests, and remaining set for other tests, so a bulk test-all fails because disablePeephole is true for all. Reset disablePeephole in Node.reset Switch HashSet for BitSet (touches all). * Restructure Node class Group printing, group node & edge manipulations, group optimizations. Also, fix LoopRegion idom, it does not use Region idom but uses the original * SeaOfNodes#44 Node printing * SeaOfNodes#44 Node printing * SeaOfNodes#44 Fix control edges in loop region Change label of loop region Fix the output count in dump * SeaOfNodes#44 Revise dump output * SeaOfNodes#44 When a LoopRegionNode is duplicated, ensure the dupe is also a LoopRegionNode * SeaOfNodes#44 When a LoopScopeNode is merged, we merge the names set too * SeaOfNodes#44 When a LoopScopeNode is merged, we merge the names set too * SeaOfNodes#44 Fix print1() on RegionNode to use label() * SeaOfNodes#44 Fix bug caused by incorrect comparison of nodes between body and head of loop; the check must be performed before any phis are created * Revert "SeaOfNodes#44 Fix bug caused by incorrect comparison of nodes between body and head of loop; the check must be performed before any phis are created" This reverts commit 5f72970. * SeaOfNodes#44 Fix bug caused by incorrect comparison of nodes between body and head of loop; the check must be performed before any phis are created * SeaOfNodes#44 when we create a phi incrementally for a loop region, all scopes that are cloned from the original must get the same phi update * SeaOfNodes#44 test case * SeaOfNodes#44 test case * Squashed commit of the following: commit 15666e2 Author: Cliff Click <[email protected]> Date: Mon Nov 27 09:45:40 2023 -0800 lazy/eager phis Eager phis by default, but can flip Parser.LAZY to switch to lazy phis. Several tests golden answers change when flipping this flag due to minor node renumbering. Phi combines same_inputs and singleUniqueInput. Fancier basic-block-like printing. Uses isMultiHead & isMultiTail which show up in many Nodes. Remove blanks in triple-quote strings. commit 6ea7018 Author: Cliff Click <[email protected]> Date: Sun Nov 26 11:13:22 2023 -0800 Remove dead scopes Add a debug find commit a52c06a Author: Cliff Click <[email protected]> Date: Sun Nov 26 10:21:48 2023 -0800 No constraints on backedges nicer loopy graphs commit b5ab550 Author: Cliff Click <[email protected]> Date: Sun Nov 26 10:13:22 2023 -0800 Fix regression commit 30a7f5c Author: Cliff Click <[email protected]> Date: Sat Nov 25 21:51:47 2023 -0800 minor cleanup commit ad742b7 Author: Cliff Click <[email protected]> Date: Sat Nov 25 21:47:05 2023 -0800 Fixes lazy phi Scope now takes a 'loop' option on dupping; the dup'ed Scope is filled with "Lazy Phi" sentinels - markers to indicate a Phi is need if this variable is ever referenced. If its never referenced, at the loop exit the "Lazy Phi" unwinds back to the original value. Lookup and update calls lazily insert concrete Phis over "Lazy Phis" at first touch. Rename _allScopes to _xScopes its "active" not "all" scopes now. Remove try/finally block at end, because a compiler bug throws, then attempts a GraphViz on a broken graph, then throws again, hiding the original bug. Removed 1 extra layer of Scopes. Scope printing now prints in edge order; added a reversemap for printing. More touches to ascii printing. * Remove flag to parseBlock * Bugfix for lazy on empty loop body Remove extra phi name-matching code * Keep head alive until entire end_loop merging is done * Create chapter 8 as a copy of chapter 7 * SeaOfNodes#44 Chapter 7 is now eager phis only (SeaOfNodes#46) * SeaOfNodes#44 Chapter 7 is now eager phis only * MOVE IR Printing to dedicated class to declutter Node. Remove Ary (SeaOfNodes#49) * SeaOfNodes#44 Move IR printing to dedicated class to declutter Node, and remove Ary * SeaOfNodes#44 refactor Node.delUse() to use common del() * SeaOfNodes#44 Some cleanups * SeaOfNodes#44 Some cleanups * SeaOfNodes#44 Some cleanups * SeaOfNodes#44 Some cleanups * Revert "SeaOfNodes#44 Some cleanups" This reverts commit 2702c33. * SeaOfNodes#44 Some cleanups * SeaOfNodes#44 Some cleanups * SeaOfNodes#44 Some cleanups * SeaOfNodes#44 Fix typo * SeaOfNodes#44 Fix markdown formatting * SeaOfNodes#44 Remove line numbers from code snippets --------- Co-authored-by: Cliff Click <[email protected]>
- Loading branch information