summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Chapter20 initial pushCliff Click2025-02-07175-0/+24507
|
* Late arrive ch19 bugfixCliff Click2025-02-071-4/+4
|
* Ch19 (#155)Cliff Click2025-02-07192-52/+25287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* more readme updatesCliff Click2025-01-203-6/+8
|
* Minor readme updatesCliff Click2025-01-202-30/+33
| | | | Add linear history links
* Add testRedeclareVar in all later chapterstannal2025-01-1915-0/+150
|
* Add a test for redefining variables in chapter 3tannal2025-01-181-0/+10
|
* Minor bugfix, allow "ptr.fld op= expr" formCliff Click2025-01-184-41/+84
|
* Missing update?Cliff Click2025-01-151-0/+1
|
* Minor fuzzer bugsCliff Click2025-01-154-6/+7
| | | | | | | Missing SubF Missing progress dep Missing null check Different fuzzer errors if peeps on/off
* 2 more fuzzer bugsCliff Click2025-01-153-21/+11
|
* MergeSort to its own fileCliff Click2025-01-154-8/+78
| | | | | Allow self-recursive forward refs. Missing progress.
* Prevent self-inliningCliff Click2025-01-154-13/+34
| | | | Better error message for self-calling functions
* Missing constant testCliff Click2025-01-153-2/+21
|
* Remove over-strong assertCliff Click2025-01-152-5/+6
|
* Some dead inf call bug fixesCliff Click2025-01-159-20/+50
| | | | | | | More comments about meeting nil above the center line falls - but does not (can not) dual. This implies have TFPs with *no* allowed functions that are below centerline; if allowed null then its basically an alternate null. If not allowed null and not allowed any functions, its basically a high value (not executable). IfNode folds. Do not remove a dead infinite loop - it needs to remain as a CFG sink.
* Fix deep co-recursive type checkCliff Click2025-01-155-22/+85
|
* Missing "!" check for finding a type declCliff Click2025-01-151-0/+1
| | | | In "N? !n" , "N?" is a type and "n" is the declared variable.
* Update README.mdCliff Click2025-01-151-3/+3
|
* Start to fix maven failsCliff Click2025-01-151-1/+1
|
* Final vars and forced constants do not lazy-phiCliff Click2025-01-153-6/+33
| | | | Better comments on why a field is final
* Promote outside of constructorsCliff Click2025-01-156-15/+40
| | | | | Var picks up a Real(tm) isFRef flag. Minor progress bug.
* Update FunNode.javaCliff Click2025-01-151-5/+4
|
* Forward Ref type to BottomCliff Click2025-01-159-22/+96
| | | | | | So FRefs can strictly lift when defined. Parser can support forward refs in more cases, by upcasting now and proving the cast is correct later. Monotonic for some float ops.
* Fix a series of small bugsCliff Click2025-01-159-35/+92
| | | | Various kinds of missing checks, over-aggressive asserts, and a few odds and ends
* Series of minor bugsCliff Click2025-01-155-9/+66
|
* Update README.mdCliff Click2025-01-151-2/+2
|
* JSView for functionsCliff Click2025-01-158-45/+67
| | | | | Constants use glabel in JSView. TypeFunPtr gprint uses "&rarr;" instead of "->"
* More READMECliff Click2025-01-151-24/+53
|
* Rewrite ReadmeCliff Click2025-01-151-54/+146
|
* Finalize function semanticsCliff Click2025-01-1515-186/+245
| | | | | | | Rename ScopeMin to MergeMem. Move Var to its own file. Allow out-of-scope id lookups in functions, as long as its a final constant. This allows e.g. factorial to find "fact" as an out-of-scope final constant function.
* Add Call/CallEnd in many CFG walksCliff Click2025-01-156-9/+51
| | | | | | Can store into an array. Check array is "of nullable" Add crazy closure test
* Handle recursive functionsCliff Click2025-01-158-96/+363
| | | | | | Define a "Return PC" type, which maps a simple bit vector to call sites. Returns take an RPC; function headers merge RPC from all callers. Work over the Eval2 control path to support recursion; probably 90% to closures now as well.
* Cleanup Eval2Cliff Click2025-01-152-64/+86
|
* Add function forward refsCliff Click2025-01-1529-166/+333
| | | | | | Add FRefNode, making and defining a forward ref. Forward refs promote out of scopes instead of being an undefined error. Add location data to all errors, because introducing more "delayed errors"- forward references are not errors if they get eventually defined. Touches many Nodes. Fix FunNode idom/idepth.
* Compile pipeline deals with functionsCliff Click2025-01-1519-131/+290
| | | | | | | | | Pretty-print functions. GCM deals with functions. Tighten linker API. CallEnd asserts harder proper graph. Eval2 makes (non recursive) function calls Peeps infer sharper function return sigs.
* Getting error code to report same w/out peepsCliff Click2025-01-1521-44/+93
| | | | | | | | | Parse "arg--2" as "arg - -2" and not "arg-- 2". Use ParserException instead of RuntimeException. Add a Field w/out final test. Allow Float NaN to hash/compare Bug cast didn't check type when GVN Better handling of dead return/exit paths
* Test for "arg--2"Cliff Click2025-01-1517-2/+88
| | | | Parse as "arg - -2" and not "arg-- 2" which is a syntax error
* More getting errors reliableCliff Click2025-01-1511-87/+94
| | | | | ...with and without peeps. Float moves out of the TypeNil set. Eval2 picks up the FLT compares.
* More precise error reportingCliff Click2025-01-1524-155/+211
| | | | | | | Demand CFG cleanup, even if peeps are off; cleans up some tests & a lot of fuzzer bugs related to trying to find infinite loops in dead code. Logical subclass for better error reporting on &,|,^,>>,<<,>>> More precise error reporting on multi returns and trinaries Fuzzer uses new Eval2
* Update README.mdCliff Click2025-01-151-0/+15
|
* Parallel assign PhisCliff Click2025-01-152-67/+106
|
* New evaluator, more Compiler Driver cleanupCliff Click2025-01-1552-619/+1073
| | | | | | | | | | 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-157-7/+7
|
* Cleanup compile driverCliff Click2025-01-1559-1179/+1693
| | | | | | | | | | Top level makes a "main" function and calls it. Opto() pass inlines main into top-level and removes the function call. If peeps are off, the function call remains; this breaks many tests. Add a FunNode function header; Return is its end. Return no long used at the top level; only a single return per-function, merging all returns (breaks many tests). Add a Call & CallEnd nodes. Fix many tests to pass again. Fix a bunch of minor bugs.
* Intercept first function definitionCliff Click2025-01-153-6/+63
|
* Clean up public API for nil/byte testingCliff Click2025-01-1513-99/+79
|
* All parsing null to be TFP or TMPCliff Click2025-01-1551-429/+1606
| | | | | | | | Insert a TypePtr/TypeNil around TypeMemPtr and TypeFunPtr in the lattice; allows the parsing of "null" to mean either a TMP or TFP null. Cleanup Type null checks and several prints. Drop Type.lub, Type.makeInit. Add a Parser NIL & ZERO. Clean up parser errors, track line numbers for future parser errors.
* Add a tighter/graphviz-oriented type printCliff Click2025-01-158-4/+37
|
* Update README.mdCliff Click2025-01-151-0/+3
|