summaryrefslogtreecommitdiff
path: root/chapter12
Commit message (Collapse)AuthorAgeFilesLines
* Major overhaul debug printingCliff Click2026-09-173-213/+558
|
* Get makefiles and fuzzer testing uniform across chaptersCliff Click2026-09-173-5/+37
|
* Fix stale copy-pasted comment on BoolNode's phiCon call (#249)Symious2026-09-091-3/+3
| | | | | | | | | | | | | | | | | | The three comment lines above `AddNode.phiCon(this, ...)` in BoolNode were copy-pasted from MulNode and never adapted: they use `*` as the operator and describe the rotated shape `(x * (phi cons)) * con`. For BoolNode neither is right. The operator is a compare, and in chapters 6-9 `rotate` is hard-coded `false`, so the rotated shape is never matched; the shapes actually handled are `(phi cons) cmp con` and `(phi cons) cmp (phi cons)`. Reword the comment accordingly, and in chapters 6-9 add a line noting why rotate is off. Chapters 10-25 pass `this instanceof EQ`, so no such claim is made there. Comment-only change; no code is touched. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* Backport renaming of `Type::_print()` in Chapter13 to earlier chapters (#244)Hsiang-Ying Fu2026-07-039-17/+17
|
* Move `addUse()` return statement to `keep()` (#243)Hsiang-Ying Fu2026-07-031-6/+3
|
* More lattices for mainCliff Click2025-08-121-1/+1
|
* Cleanup (#162)RobertObkircher2025-02-163-7/+6
| | | | | | | | | * remove unused method lazyFRef * remove unused method copyF(Node, Node) * make TypeMemPtr constants final * make ConstantNode value final
* Ch19 (#155)Cliff Click2025-02-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial push Major CodeGen cleanup; most static globals move into the CodeGen object. * Minor progress bug with mutual recursion * Add test from pr#148 * First cut x86 "port" Only "return 0;", no registers, no encoding, but yah gotta start somewhere * Update README.md * Update README.md * Update ListScheduler.java * command line launcher for simple Parser bug fref in args Some new test cases. * Add basic RegMask for more than 64 bits of register mask. Add calling convention basics to X86; con+ret RegMasks. GCM computes CFG for all users. Drop unused MultiUse. Pick up reg-pressure aware ListScheduler. Re-layout CodeGen file to get code & data chunks nearer each other. minor Ary extension * ASM Printer InstSel handles folding 2+ ideal ops into 1 machine op * handle instSel for some control flow Bool,If,CProj,Region,Phi Handle 2-op expansions Shuffle instSel graph walk back again. * Basic if-block inst selects and asm prints * Add mul-by-coinstant to shift * left shift codegen basic * exclude RSP from *write* mask * 2-arg add (not immediate) mul-by-small constant opt. Some utilities. * Handle first loop Change inst sel walk again to pre-order, to set an early visit bit to stop cycles. CFGNode copies dom/loop info. Cmp not-immediate form. Ret/Fun lazy updates * inst select for new struct allocation * Float, bitwise and arithmetic operands codegen x86-64 (#150) * left shift codegen basic * sar codegen basic * merge * some basic ops * addf * divf, subf, mulf * rsp allowed in bitwise input, not output * formatting * left shift codegen basic * sar codegen basic * merge * some basic ops * addf * divf, subf, mulf * rsp allowed in bitwise input, not output * formatting * Remove non-exsting FP+imm ops * Handle first loop Change inst sel walk again to pre-order, to set an early visit bit to stop cycles. CFGNode copies dom/loop info. Cmp not-immediate form. Ret/Fun lazy updates * float ops without imm values * merge * merge * inst select for new struct allocation * left shift codegen basic * sar codegen basic * merge * some basic ops * addf * divf, subf, mulf * rsp allowed in bitwise input, not output * formatting * Remove non-exsting FP+imm ops * left shift codegen basic * sar codegen basic * merge * some basic ops * addf * divf, subf, mulf * rsp allowed in bitwise input, not output * formatting * float ops without imm values * merge * merge * Rebased on ch 19 * Update tests --------- Co-authored-by: Cliff Click <cliffc@acm.org> * cleanup after merge alpha-sort helper fcns implicit test vs zero/null * Add LEA op asm print works on ideal nodes for all tests * Minor cleanup lea * x86 addressing modes during inst select Drop New taking inits; just follow with initializing stores. Simplifies inst selelection which otherwise needs to undo this optimization and emit following init stores. Basic load/store for now, op-to-mem comes later add same becomes Shl by 1. Drop DivF-immiedate * extended ch13, 14,15,16 (#153) * merge2 * merge3 * Fix a few minor fuzzer bugs * Force array layout ld/st get size (but not signed/unsigned) Add unsigned LT for later range checks. * Fix a bunch of float issues was deleting required inputs * simpler invariant defensive copy inputs for simpler invariant in complex sharing patterns inc/dec form (just the opcode now). * Call & CallR X86 instructions * Add-from-memory op Remove FP immediate forms. * Remove name from TFP Never shoulda been there (but was convenient for awhile). Moved into FunNode, found by checking the linker table with a TFP. * New (#154) * merge2 * merge3 * GCM for float ops fixed, other cleanup - small extensions * call setup * merge2 * remove debug prints add check for bad call convention fix 3 tests (bad merge?) * cleanup call convention abi Needs more love at some point... * one more cleanup ABI --------- Co-authored-by: Cliff Click <cliffc@acm.org> * Add CmpMem form Common addressing mode print LEA can skip a base * Add a AddFMemX86 A bunch of mem op patterns are missing, hopefully they are just cut-n-paste from the existing patterns. * Docs * XMM reg mask fix Minor README updates * Allow inverted cmp/mem narrowing stores can bypass an AndMask Array length loads do not need control Some missing print info * Support "*ptr op= val" at least for MemAdd * missed golden rule update * Array len is u32 load-after-store zero/sign-extends if the store is truncating * One more missed case --------- Co-authored-by: hadha <helsgithub15@gmail.com> Co-authored-by: Tamás Hadházy <85063808+Hels15@users.noreply.github.com>
* Add testRedeclareVar in all later chapterstannal2025-01-191-0/+10
|
* Test for "arg--2"Cliff Click2025-01-151-0/+6
| | | | Parse as "arg - -2" and not "arg-- 2" which is a syntax error
* New evaluator, more Compiler Driver cleanupCliff Click2025-01-151-1/+1
| | | | | | | | | | More compiler driver cleanup: Stop only has Return inputs, never an expr. Drop extra lexical scope. Linker table moves to CodeGen. Replace evaluator with a simpler design; I was unable to get the current design to work with the other changes. Updates to old eval; proper idoms; forced type checks; extensions for Fun, Return, Call, CallEnd. Accessor find next control to execute. Accessor for deciding when its ok to optimize a Function/Return, Call/CallEnd, Stop, ScopeMin (merge) Add local scheduling pass. IRPrinter uses SB instead of StringBuilder Spelling SubF comment
* Fix commentCliff Click2025-01-151-1/+1
|
* More lattice docs reworksCliff Click2025-01-153-1/+782
|
* Link to linear history and tag chaptersThalia Archibald2024-10-231-0/+4
|
* more grammar cleanupCliff Click2024-10-131-1/+1
|
* update grammar filesCliff Click2024-10-131-2/+7
| | | | no idea if these are right, but seem closer to the mark
* Turn off all printing during test runsCliff Click2024-10-1211-139/+121
| | | | was making 10000 lines of ignored output
* remove peephole from ProjNode::idealize that is already handled by computeRobert Obkircher2024-09-161-10/+7
|
* move x-x check up frontCliff Click2024-09-131-3/+4
|
* x-x==0Cliff Click2024-09-132-5/+10
| | | | | | Move x-x==0 to compute. Add x/1 ==> x All chapters
* Fix GCM of CSE storesCliff Click2024-09-125-11/+24
| | | | | Stop CSE of stores. Backports to ch11,12,13,14
* README includes more design decisions for type names.Cliff Click2024-09-071-0/+4
| | | | Add Or,Xor for completeness.
* Backport empty statement fixCliff Click2024-09-071-0/+1
| | | | | Split Ch13 tests from Chapter12Test.java Handle forward refs never defined.
* #98 Chapter 14 arraysdibyendumajumdar2024-09-071-0/+1
|
* Update fuzzer for chapter 12. (#104)XmiliaH2024-08-182-37/+73
|
* #92 Update readmesdibyendumajumdar2024-08-061-3/+1
|
* Fix chapter12 grammarThalia Archibald2024-08-061-1/+1
|
* Unify type parsingCliff Click2024-08-051-48/+22
|
* Update Ch12 readmeCliff Click2024-08-051-1/+45
|
* Fuzzer nit picksCliff Click2024-08-053-8/+4
|
* auto-widen on assignCliff Click2024-08-052-125/+11
|
* missing null checkCliff Click2024-08-052-2/+121
|
* A series of minor fuzzer bugsCliff Click2024-08-055-27/+28
|
* Better filter on Load cloneCliff Click2024-08-052-6/+20
|
* Float bugsCliff Click2024-08-0520-42/+113
| | | | | | | | Fix bug infinite loop finding. Fix inf loops before printing graph. Missing float unary negate . Generator makes float exprs Fix missing dep in LCA finding
* Clean up floatsCliff Click2024-08-057-53/+48
| | | | Better pattern in the compiler.
* a little FP cleanupCliff Click2024-08-052-7/+6
|
* more fp bugfixesCliff Click2024-08-054-6/+5
|
* minor FP bugsCliff Click2024-08-056-17/+23
| | | | | Fix bug AddF+0, SubF+0 Fix bug flipping EQ sides.
* Add Float supportCliff Click2024-08-0513-47/+463
| | | | Parsing float constants; float +-*/, auto-widening float expressions.
* minimal empty test so "make" doesnt complainCliff Click2024-08-051-0/+11
|
* #92 chapter 12 start from chapter 11dibyendumajumdar2024-08-0568-0/+10399