| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Require resolved integer mode in chapter 25 so zero subtraction preserves floating-point signed zero. Keep nonnumeric operands in the graph for subtraction diagnostics.
Add signed-zero coverage from chapter 12 and null-subtraction diagnostics from chapter 22. Confirmed the regressions fail on the original PR. Full Make suites pass in chapters 4-25 (5462 tests), including fresh chapter 25 sys.o compilation.
|
| | |
|
| |
|
|
| |
all chapters, a little sharper for int ops
|
| |
|
|
| |
Phis stay with regions, stop sinks to bottom,
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The add canonicalization builds a left-leaning chain of AddNodes -- the
"spine" -- with off-spine operands hanging off each in(2). The comparator
and its comments were spelled "spline" (a curve / mechanical part), which
was already inconsistent with the goal comment in the same method:
// Goal: a left-spine set of adds, with constants on the rhs
Chapters 9 and later already use "spine" / "spine_cmp"; this brings the
earlier chapters in line.
Comment and private-method-name only, no behavior change.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
* remove unused method lazyFRef
* remove unused method copyF(Node, Node)
* make TypeMemPtr constants final
* make ConstantNode value final
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Move x-x==0 to compute.
Add x/1 ==> x
All chapters
|
| |
|
|
|
| |
Split Ch13 tests from Chapter12Test.java
Handle forward refs never defined.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Backport test exception handling to chapter 1
* Add unary ! to chapter 10 and 11 grammars
* Lex { } ! as punctuation
* Forward-port format whitespace
* Forward-port test organization
* Forward-port replace build-graphs.sh with Makefile
* Add chapter title to chapter 11
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix unexpected number parse errors
* Add chapter titles
* Split test files by chapter
* Backport rename Fuzzer08Test to FuzzerWrap
* Replace graph build scripts with Makefile
* Backport Chapter05Test.testRegress1
* Backport require space after 'return'
* Backport check EOF after return statement
|
| |
|
|
|
|
|
|
|
| |
* Trim trailing whitespace
* Ensure final new lines
* Convert line endings from CRLF to LF
* Replace tabs with spaces
|
| |
|
| |
Also fix broken links in README
|
| |
|
|
|
|
|
|
|
|
|
| |
* #44 Revise docs and comments
* #44 Add starting scope to xScopes
* #44 back some of the code refactoring port to previous chapters
* #44 add_def should not be public
* #44 add_def should not be public. Rename method names so that they are camelcase
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* #37 Create chapter 6 skeleton
* #37 Revise type system - TOP, BOTTOM, CONTROL are now directly implemented in Type, XCONTROL is a new type and that's implemented directly too.
We have a _type field that is like an enum.
* #37 Revise Type.meet() - this is now final.
Subclasses can override xmeet() which is protected but
now handles simple types in Type itself.
* #37 Basic test for peephole of CFG
* #37 Revise compute of if
* #37 Revise compute of if
* #37 WIP peephole of If
* #37 WIP peephole of If
* #37 WIP peephole of If
* #37 WIP peephole of If
* #37 WIP peephole of If
* #37 WIP fix the chars inserted by IntelliJ
* #37 WIP Fix compute type in IfNode
* #37 WIP Null check region inputs
* #37 WIP Fix where we choose great grand parent instead of grand parent
Add new test
* #37 WIP More fixes and tests
* #37 WIP Some minor adjustments
* Cleanup folding dead IF tests
Remove isDeadCtrl & just test for the constant.
Remove DEAD_CTRL, doesn't properly reset between tests.
Move keep/unkeep to Node.
PhiNode has a proper compute() call.
ProjNode ideal is a lot simpler.
Region doesn't ever get a null.
Move the mergeScopes Region peep till after all Phis are added.
Type TOP and XCONTROL count as constants.
TypeTuple gets a toString
* #37 WIP Upate README
* #37 WIP Region node should check if one of its inputs is a region that needs to be peepholed
* #37 WIP If node should check if its ctrl input is a Region that has only 1 live input so can be peepholed
* #37 WIP Further update to README to make the peephole logic clearer. Also discuss the relationship between Region and Phi nodes
* Region removes dead input paths
Remove region-folding in Return, If.
Add a Makefile.
Reformat triple-quote lines to be emacs-friendly.
* StopNode idealize
Return type sharpens to include control input.
* Remove !=, >=, >; use Not and <, <=, ==
Fix bug mixing rotating different ops.
Generalize Add fold constants; apply to Mul, EQ.
Fix Div.copy
* Fix bug rotating e.g. < or <=
Peep is only valid for associative ops
* #37 WIP Doc updates
* Work over the Ch6 Readme
Major issue: Region inputs align 1-to-1 with Phi inputs, but a Region can have zero to many Phis. When we lose a Region input (dead path), we need to lose the same inputs to each Phi - but we don't lose the Phis themselves, unless we're folding away down to the last live input.
* Update chapter06/README.md
Co-authored-by: Yichen Yan <oraluben@outlook.com>
* Update chapter06/README.md
Co-authored-by: Yichen Yan <oraluben@outlook.com>
* #37 Backport type system changes to chapter 2
* #37 Backport type system changes to chapter 3
* #37 Backport type system changes to chapter 4
* #37 Backport type system changes to chapter 5
* #37 Merge chapter 5 updates from main.
Remove language grammar module as we describe the grammar incrementally in each chapter.
* #37 Chapter 6 doc updates - added visuals to show effects of CFG peephole
* #37 Sync some updates to chapter 2
* #37 Sync some updates to chapter 3
* #37 Sync some updates to chapter 4
---------
Co-authored-by: Cliff Click <cliffc@acm.org>
Co-authored-by: Yichen Yan <oraluben@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
documentation (#34)
* Backport changes from chapter 5 to older chapters (#30)
* Fix wrong indent
* Backport to chapter 4
* Backport to chapter 3
* Backport to chapter 2
* Backport to chapter 1
* Add if statement to comment (#32)
* Update visuals for chapters 1,2 & 3.
Reenable drawing of edges from constants to Start for these chapters.
* Update visuals for chapters 4.
Revise text to explain the labeling of edges in graphs and that we omit edge from Constant to Start nodes from chapter 4.
* Add code snippets for if statement parsing and the duplication and merging of ScopeNodes.
Explain how scopeNodes are duplicated and merged.
* Add constant check to minus node (#31)
* Fix closing root block with } (#33)
* Backport fix closing root block with } to chapter 4 and 3 (#35)
* Show use-def edge from Phi to Region as dotted edge.
Add example of Phi peephole.
Update visuals.
Add more examples.
* Fix visuals in chapter 1 and README in chapter 4.
* Remove subheading
* Adjust spaces
---------
Co-authored-by: XmiliaH <45106915+XmiliaH@users.noreply.github.com>
|
| |
|
|
| |
Remove parseBlock flag, and just require the missing `}`
|
| |
|
|
|
|
|
|
|
| |
* Report unclosed block in parsing
* Fix tests
* Resolve comments and rebase onto chapter5
* Test `isEOF` after consume whitespaces
|
| |
|
|
| |
This reverts commit e3c412bbbdd6f6eefe2ac889f6d59aeaef71beb1.
|
| | |
|
| |
|
|
|
|
|
| |
* Wrong input index used
* Then is currently not a keyword
* Some phis are now not created and ids shifted
|
| | |
|
| |
|
|
| |
Region edges need to align with Phi edges; missing leading null
|
| | |
|
| |
|
|
| |
Make an official TODO which can't be hit in the current Chapter, but future binary ops might hit it.
|
| |
|
|
|
|
|
|
|
|
|
| |
* Return null when the node cannot be copied
* Make add_def package private again
* Phi node can have more then two data inputs in theory
* Use swap12
* Use addUse
|
| |
|
|
|
|
|
|
| |
Merging common edges.
Phis of same Region align.
Phis use greek phi, and have a debug name. Scope carries the debug name. Phis are lightly colored.
Common math names for math prims.
Parse can optionally show the graph after closing the last scope.
|
| | |
|
| |
|
|
| |
More rigorously head for a left-spline sum-of-products format.
|
| |
|
|
|
| |
higher level parsers can return null, but their return is ignored anycase.
div-by-0 is defined to be 0, backported to ch2,3,4,5
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Add an exact 'matchx' for keywords. Add a list of keywords.
int true=0; return true; // Expected id, found 'true'
int else=arg; if(else) else=2; else else=1; return else; // Expected id, found 'else'
inta=1; return a; // undefined inta
|
| |
|
|
| |
Add true/false
|
| |
|
|
|
|
| |
Return returns a tuple of control & result
GraphViz works with multi-Scopes and Scopes do not double-print uid.
Proj also does not print uid in golden test results, because every time we add a new early node, the final results change node id so fail golden test.
|
| |
|
|
| |
Fix GraphVix node edge ordering
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Rename CTRL_TOKEN... its not a token.
_allScopes becomes a Stack, because... it behaves like a stack.
Add a junk Phi peep.
More general AddNode peeps
Add a bunch of If tests.
Rewrite how expected-exception tests work; the workflow on the old technique sucked. New one stops in the right place in the debugger.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Fix test cases broken due to renaming of ProjNode label.
Cleanup the way we update $ctrl token
Assign an ID to each ScopeNode so that when we visualize we can assign different names
|
| |
|
|
|
|
| |
Drop Control interface, not flexible enough. Use isCFG() call, overloaded in child classes. Projections have a more complex test.
Missing some printouts in Bool children, If, Region, Phi.
IfNode type is a tuple. Region is TypeControl.
|
| |
|
|
|
| |
No type compute yet
Initial parsing logic for If statements
|