Slava Pestov
e27adb2830
compiler: re-architect low-level optimizer to allow more than one output value per instruction
2010-07-13 07:40:14 -04:00
Slava Pestov
e86f434f26
Add GC maps to ##box, ##box-long-long, ##alien-invoke, ##alien-indirect and ##call-gc; remove ##gc-map instruction
2010-06-14 19:39:46 -04:00
Slava Pestov
806e54630a
GC maps for more compact inline GC checks
2010-06-11 20:06:00 -04:00
Slava Pestov
ba7cb61133
Stack allocation improvements
...
- New with-out-parameters combinator
- Inhibit tail call optimization in frames with local allocation, to ensure that passing a stack allocated value to the last word in the quotation works
- local allocations are now aligned properly
- spill slots are now aligned properly aligned in frames which have parameter and local allocation areas
2010-05-22 02:37:00 -04:00
Slava Pestov
0955f2c7eb
compiler.cfg.linear-scan: fix typo
2010-05-17 05:50:13 -04:00
Slava Pestov
3f8e13bf66
compiler.cfg: refactor stack frame code and fix frame pointer usage in callbacks
2010-05-16 21:04:40 -04:00
Slava Pestov
5b48cd2a63
FFI rewrite part 5: return value boxing and callback parameter boxing now uses vregs; simplify return value unboxing
2010-05-16 03:43:23 -04:00
Slava Pestov
6d30bb8bf4
compiler.cfg.linear-scan: pointless optimizations
2010-05-14 18:37:08 -04:00
Slava Pestov
d1e422c981
compiler.cfg.alias-analysis: simplify and speed up
2010-05-14 18:37:07 -04:00
Slava Pestov
eb802208d1
FFI rewrite part 4: parameter and return value unboxing redesign
2010-05-11 19:11:44 -04:00
Slava Pestov
982e704626
compiler.cfg.linear-scan: clean up clobber-insn handling
2010-05-07 18:22:35 -04:00
Slava Pestov
627295f094
Language change: tuple slot setter words with stack effect ( value object -- ) are now named FOO<< instead of (>>FOO)
2010-05-06 17:21:02 -04:00
Slava Pestov
f5c5d8b44c
compiler: remove flat machine representation and generate code directly from the CFG
2010-05-03 17:34:32 -04:00
Slava Pestov
7f6ae34d72
Updating tests for recent compiler changes
2010-05-03 17:34:30 -04:00
Slava Pestov
38bafd2be8
compiler.cfg.linear-scan.assignment: spill slot representation logic was backwards, just like Factor
2010-05-03 17:34:29 -04:00
Slava Pestov
ffd1844d52
compiler.cfg.linear-scan: clean up spill slot assignment
2010-05-03 17:34:24 -04:00
Slava Pestov
43f269e4eb
Register allocation now uses SSA properties to coalesce values with different representations
2010-05-03 17:34:20 -04:00
Slava Pestov
9b34a4a054
compiler.cfg: remove unused 'reps' slot from compiler.cfg, and re-organize things in preparation for SSA register allocation
2010-05-03 17:34:18 -04:00
Slava Pestov
43fc230c69
compiler.cfg.linear-scan: cleanups
2010-05-03 17:34:18 -04:00
Slava Pestov
95ff5ffe51
New GC checks work in progress
2010-05-03 17:34:16 -04:00
Slava Pestov
db7403d697
compiler.cfg.linear-scan.resolve: fix incorrect behavior when one physical register is used with several representations in the same register class
2010-05-03 17:34:14 -04:00
Slava Pestov
51b13ce373
compiler.cfg.linear-scan: don't insert a _reload if the register is going to be overwritten anyway
2010-05-03 17:34:14 -04:00
Slava Pestov
5d3a7a7362
Untagged fixnums work in progress
2010-05-03 17:34:02 -04:00
Slava Pestov
503c0fcfde
compiler: Start using tagged-rep for stuff, and split up compiler.cfg.representations into several sub-vocabularies
2010-05-03 17:34:01 -04:00
Daniel Ehrenberg
7cd3360cdd
Fixing ambiguity between sets and namespaces in many unit tests and furnace.auth
2010-02-26 17:17:40 -05:00
Daniel Ehrenberg
6298203b4c
Making all of basis and extra unambiguous for sets/namespaces
2010-02-26 16:28:38 -05:00
Daniel Ehrenberg
7074979745
Moving new-sets to sets
2010-02-26 16:01:01 -05:00
Doug Coleman
1476cdb974
reverse-here -> reverse!
2009-10-28 14:40:15 -05:00
Slava Pestov
299b5b0f6c
filter-here -> filter!
2009-10-28 00:44:05 -05:00
Slava Pestov
50f5c3d116
remq -> remove-eq, delq -> remove-eq!
2009-10-28 00:23:08 -05:00
Slava Pestov
951e3e9c83
delete-nth -> remove-nth!
2009-10-27 23:41:57 -05:00
Slava Pestov
d48c72a274
compiler.cfg: fix unit tests
2009-10-15 06:01:46 -05:00
Slava Pestov
5b40fc6533
compiler.cfg.linear-scan: fix unit test
2009-10-05 18:21:58 -05:00
Slava Pestov
b4e36608da
compiler.cfg: remove _gc instruction, it doesn't need to exist, and change GC checks to ensure that the right amount of space is available instead of blindly checking for 1Kb
2009-10-05 05:27:49 -05:00
Slava Pestov
2de6ab9e21
compiler.cfg.linear-scan: fix tests for hash order
2009-09-27 23:35:56 -05:00
Slava Pestov
1d872db58d
compiler.cfg.linear-scan: tweak it so that register allocation does not depend on hashing order
2009-09-27 23:29:48 -05:00
Slava Pestov
705b4ab5c3
compiler.cfg.linear-scan: fix partial sync point logic in case where dst == src, and clean up spilling code
2009-09-27 19:28:20 -05:00
Slava Pestov
513ba1f176
compiler.cfg.linearization.order: basic blocks were being inserted twice if some blocks had repeated successors, causing problems for register allocation
2009-09-22 03:19:23 -05:00
Slava Pestov
4d5a4222b6
More SIMD work
...
- Rename SIMD types and register representations: <type>-<count> rather than <count><type>-array
- Make a functor to define 256-bit vector types, use it to define float-8 type
- Make SIMD instructions pure-insns so that they participate in value numbering
2009-09-03 20:58:56 -05:00
Slava Pestov
85a2bfab6c
compiler: eliminate boilerplate by centralizing info in declarative INSN: syntax
2009-09-02 06:22:37 -05:00
Slava Pestov
447c5fbf7a
compiler.cfg.linear-scan.live-intervals: dead-value-error is never thrown anymore
2009-08-30 05:15:18 -05:00
Slava Pestov
0db01f6d5f
compiler.cfg.linear-scan now supports partial sync-points where all registers are spilled; taking advantage of this, there are new trigonometric intrinsics which yield a 2x performance boost on benchmark.struct-arrays and a 25% boost on benchmark.partial-sums
2009-08-30 04:52:01 -05:00
Slava Pestov
8bf709acd0
compiler.cfg.linear-scan: fix unit tests for new fake-representations
2009-08-26 08:58:00 -05:00
Daniel Ehrenberg
478b960560
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-14 20:11:54 -05:00
Daniel Ehrenberg
3cec74867d
Improving write barrier elimination; change to compiler.cfg.utilities to support this
2009-08-14 19:41:41 -05:00
Doug Coleman
3f3d57032b
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places, minor refactoring
2009-08-13 19:21:44 -05:00
Slava Pestov
687454878a
compiler.cfg.linearization: change order to fit older unit tests
2009-08-08 23:06:57 -05:00
Slava Pestov
d0c393aa60
compiler.cfg: new system to track when results of analyses need to be recomputed (reverse post order, linear order, predecessors, dominance, loops). Passes can now call needs-predecessors, needs-dominance, needs-loops at the beginning, and cfg-changed, predecessors-changd at the end. Linearization order now takes loop nesting into account, and linear scan now uses linearization order instead of RPO.
2009-08-08 20:02:56 -05:00
Slava Pestov
4b7ba38aab
compiler.cfg: virtual registers are integers now, and representations are stored off to the side. Fix bug in representation selection that would manifest if a value was used as a float and a fixnum in different branches; cannot globally unbox float in this case
2009-08-08 04:02:18 -05:00
Slava Pestov
725280d424
Split off the notion of a register representation from a register class
2009-08-07 17:44:50 -05:00
Slava Pestov
370f4c081d
compiler.cfg: convert code into two-operand form before SSA destruction; SSA destruction now operates on a relaxed SSA form where multiple defs of the same vreg are allowed, but only within a single basic block. This makes linear scan's coalescing redundant, allowing it to be removed completely
2009-08-05 18:57:46 -05:00
Slava Pestov
c1c8424605
Compiler speedups
2009-08-02 09:16:21 -05:00
Slava Pestov
e1c7f7394a
compiler.cfg: clean up unit tests using some new utilities
2009-08-02 03:49:25 -05:00
Slava Pestov
791fbe4003
compiler.cfg.linear-scan: fix case where a register can be made available for only a part of a live interval's lifetime, but there are no more usages after the split location. This case never came up until global stack analysis, at which point it started to be exercised on x86-32
2009-07-30 02:13:30 -05:00
Slava Pestov
cb36a40dc4
compiler.cfg.linear-scan: more test fixes
2009-07-29 07:04:52 -05:00
Slava Pestov
639a1cbb1f
compiler.cfg.linear-scan.resolve: fix unit tests to not depend on hashing
2009-07-29 06:48:01 -05:00
Slava Pestov
74766d1ccd
compiler.cfg.linear-scan.assignment: modifies instructions in place instead of storing a registers assoc for further compile-time performance improvement
2009-07-29 06:36:14 -05:00
Slava Pestov
1532a6f2e3
compiler.cfg.linear-scan.assignment: more efficient data structures
2009-07-29 06:12:33 -05:00
Slava Pestov
d913d7331f
compiler.cfg: Minor optimization. Instructions can now only ever produce a single value; this eliminates 1array constructions and some iterations
2009-07-28 12:29:07 -05:00
Slava Pestov
80e10f1bd0
compiler.cfg: Fix some unit tests
2009-07-28 08:56:14 -05:00
Slava Pestov
e6f5eab598
compiler.cfg.linear-scan: fix resolve pass
2009-07-28 08:47:35 -05:00
Slava Pestov
18717a449f
compiler.cfg.linear-scan.resolve: unit tests
2009-07-28 07:41:41 -05:00
Slava Pestov
857ef94acc
compiler.cfg.linear-scan: use compiler.cfg.parallel-copy in resolve pass
2009-07-28 07:39:46 -05:00
Slava Pestov
b1afd4c491
compiler.cfg.linear-scan.mapping: simplify
2009-07-23 18:03:04 -05:00
Slava Pestov
89db2e745d
Move liveness back to compiler.cfg.liveness, fix a corner-case where it didn't work on some forms of non-SSA code
2009-07-22 06:07:28 -05:00
Slava Pestov
21a012e3d7
compiler.cfg: Major restructuring -- do not compute liveness before local optimization, and instead change local optimizations to be more permissive of undefined values. Now, liveness is only computed once, after phi elimination and before register allocation. This means liveness analysis does not need to take phi nodes into account and can now use the new compiler.cfg.dataflow-analysis framework
2009-07-22 03:08:28 -05:00
Slava Pestov
32e4a97855
compiler.cfg.linear-scan: fix tests
2009-07-18 06:10:01 -05:00
Slava Pestov
ea69566ddd
compiler.cfg.linear-scan: algorithmic optimizations
2009-07-18 00:14:39 -05:00
Slava Pestov
e76dce8aff
Overflowing fixnum intrinsics now expand into several CFG nodes. This speeds up the common case since only the uncommon case is now a stack syncpoint
2009-07-16 18:29:40 -05:00
Slava Pestov
884e41dd9c
compiler.cfg.linear-scan.live-intervals: remove bogus assertion
2009-07-16 02:42:01 -05:00
Slava Pestov
c860a3b1e6
compiler.cfg: update unit tests for compiler.cfg.comparisons
2009-07-14 12:06:55 -05:00
Slava Pestov
8ff473e42c
compiler.cfg.linear-scan.resolve: get it to work on CFGs with critical edges
2009-07-12 23:00:33 -05:00
Slava Pestov
1cf6bb7f99
compiler.cfg.linear-scan: disable unit test for unimplemented feature
2009-07-10 07:48:49 -05:00
Slava Pestov
ae67de6f90
compiler.cfg.linear-scan: fix fencepost error in spill insertion
2009-07-10 03:58:51 -05:00
Slava Pestov
dea872c7e3
compiler.cfg.linear-scan.allocation: fix broken spill slot reuse logic
2009-07-10 00:25:46 -05:00
Slava Pestov
d02854b04e
compiler.cfg.linear-scan: two live intervals which are coalesced will use the same spill slot
2009-07-09 23:12:49 -05:00
Slava Pestov
d0980edafe
compiler.cfg.linear-scan: fixing unit tests
2009-07-09 00:48:00 -05:00
Slava Pestov
5a64290386
compiler.cfg.linear-scan: more code cleanups, and working on split-to-fit algorithm
2009-07-09 00:20:03 -05:00
Slava Pestov
4507bdcbc0
compiler.cfg.linear-scan: code cleanups
2009-07-08 23:28:28 -05:00
Slava Pestov
c20e6c290f
compiler.cfg.linear-scan: split off parallel mapping code from resolve pass, use it in assignment pass to resolve parallel copies
2009-07-08 23:07:06 -05:00
Slava Pestov
e2044602aa
compiler.cfg.linear-scan: debugging spilling, add more assertions
2009-07-07 13:01:27 -05:00
Slava Pestov
43c873f00a
compiler.cfg.linear-scan: code cleanup
2009-07-07 03:45:27 -05:00
Slava Pestov
0bcf4ce535
compiler.cfg.linear-scan: Re-implement spilling, add some additional runtime assertions, simplify assignment pass since it doesn't have to track spill slots anymore; just assume a live value that's not in active or inactive is spilled
2009-07-07 03:28:55 -05:00
Slava Pestov
4402d8652c
compiler.cfg.linear-scan: minor fixes
2009-07-05 22:51:53 -05:00
Slava Pestov
a452f32e3a
compiler.cfg.linear-scan: Get cycle breaking in resolve pass to work by allocating a spare spill slot for this purpose
2009-07-05 21:32:23 -05:00
Slava Pestov
f14a61fac2
Fix compiler.cfg.linear-scan.resolve test failure
2009-07-04 16:30:16 -05:00
Slava Pestov
c00af97fa1
compiler.cfg.linear-scan.resolve: More fixes
2009-07-04 00:45:06 -05:00
Slava Pestov
da13681bc8
compiler.cfg.linear-scan: redo resolve pass to fix a correctness issue
2009-07-03 23:38:52 -05:00
Slava Pestov
8d3a45dee2
compiler.cfg: clean up GC check generation to use spill-slot data type
2009-07-03 23:11:23 -05:00
Slava Pestov
d07c0429fc
compiler.cfg.linear-scan: assign spill slots to vregs globally, so that resolve pass never has to perform a memory->memory transfer
2009-07-03 22:51:40 -05:00
Slava Pestov
af875ba836
compiler.cfg: bug fixes in GC check insertion and fixnum intrinsics
2009-07-02 00:51:06 -05:00
Slava Pestov
e6b1c21590
compiler.cfg.linear-scan: fix spilling
2009-07-01 22:37:27 -05:00
Slava Pestov
a19f22ec82
compiler.cfg.linear-scan: debugging spilling and resolve pass
2009-07-01 17:41:07 -05:00
Slava Pestov
612e4b99b0
compiler.cfg.linear-scan.assignment: insert-copy did the wrong thing if the second interval had been split. Fixes compilation of 'trilerp'
2009-06-30 21:07:39 -05:00
Slava Pestov
d199154179
Merge branch 'master' of git://factorcode.org/git/factor
2009-06-30 18:12:00 -05:00
Slava Pestov
54876d0cba
compiler.cfg.linear-scan.assignment: get check-assignment? to work with coalescing
2009-06-30 18:10:53 -05:00
Doug Coleman
f1b2550035
Merge branch 'master' of git://factorcode.org/git/factor
2009-06-30 16:45:57 -05:00
Doug Coleman
d1f6871081
fix bug where traversal order was lost
2009-06-30 16:44:14 -05:00
Slava Pestov
578b0126fc
compiler.cfg.linear-scan: compute-free-pos was broken in the case where more than one inactive interval had the same physical register assigned
2009-06-30 16:07:58 -05:00
Doug Coleman
f41f84436c
spill to spill-temp, not to virtual spill addresses
2009-06-30 15:40:13 -05:00
Slava Pestov
82bfaca188
Fix conflict
2009-06-29 01:59:53 -05:00
Slava Pestov
0f68ee3e9a
compiler.cfg.linear-scan.resolve: remove redundant vocabs from using list
2009-06-28 22:58:35 -05:00
Doug Coleman
1cb6bc99da
Merge branch 'master' of git://factorcode.org/git/factor
...
Conflicts:
basis/compiler/cfg/linear-scan/resolve/resolve-tests.factor
2009-06-26 21:51:08 -05:00
Doug Coleman
90017eb248
add spill-temp to compiler.cfg.instructions, implement parallel register assignment in linear-scan.resolve
2009-06-26 21:48:21 -05:00
Slava Pestov
96baede36a
Redesign compiler.cfg.stack-analysis to make compiler.cfg.height redundant, and to fix some problems
2009-06-26 17:29:55 -05:00
Slava Pestov
f3cf8fad2b
compiler.cfg.linear-scan: fix unit tests
2009-06-24 13:54:12 -05:00
Slava Pestov
c53aca6016
compiler.cfg.linear-scan: fix coalescing to take lifetime holes into account
2009-06-23 21:32:51 -05:00
Slava Pestov
387f6df9e5
compiler.cfg.linear-scan: Debugging resolve pass
2009-06-22 00:24:51 -05:00
Slava Pestov
330bea3cc2
compiler.cfg.linear-scan.resolve: unit tests
2009-06-21 00:23:34 -05:00
Slava Pestov
5a78956956
compiler.cfg.linear-scan: Working on resolve pass
2009-06-21 00:20:01 -05:00
Slava Pestov
c1839200dd
compiler.cfg.linear-scan.assignment: correctly compute live registers at GC check points
2009-06-20 15:33:12 -05:00
Slava Pestov
5c912504d7
compiler.cfg.linear-scan: untangle add-active/delete-active/add-handled calls in spilling, replace 'sort-values last' with 'alist-max' in compiler.utilities
2009-06-19 18:28:30 -05:00
Slava Pestov
2f15ac3c8f
compiler.cfg.linear-scan: Fix a couple of bugs
2009-06-19 03:42:42 -05:00
Slava Pestov
1f5f8393c3
compiler.cfg.linear-scan: Further progress on inactive interval handling
2009-06-17 15:27:20 -05:00
Slava Pestov
6fb7dca404
compiler.cfg.linear-scan.resolve: fix compile error
2009-06-14 17:00:52 -05:00
Slava Pestov
64f93e41a9
Various linear scan fixes
...
insert spill before reload to fix x86-32 regression
inactive splitting: if all inactive intervals' registers are in use, don't fail
fix stack analysis tests
2009-06-13 17:35:40 -05:00
Slava Pestov
d0f6a7d048
Split up compiler.cfg.linear-scan.allocation into a number of sub-vocabularies; start work on compiler.cfg.linear-scan.resolve; start work on inactive interval splitting
2009-06-11 17:55:14 -05:00
Slava Pestov
70b75b8dea
Linear scan: implement live range intersection
2009-06-06 01:04:12 -05:00
Slava Pestov
04c72d0a72
Linear scan: correctly compute live spill slots
2009-06-05 18:06:47 -05:00
Slava Pestov
81b2a39070
compiler.cfg.linear-scan: re-do interval splitting to operate on live ranges; add inactive set processing
2009-06-04 18:53:02 -05:00
Slava Pestov
6d04bf9c4a
Linear scan: build live ranges
2009-06-03 03:22:27 -05:00
Slava Pestov
2d231f066a
GC checks now save and restore registers
2009-06-02 18:23:47 -05:00
Slava Pestov
9e987e8642
Merge branch 'master' into global_optimization
2009-06-01 03:12:32 -05:00
Slava Pestov
32f17f3e14
Fix scoping issue in compiler.cfg.linear-scan.assignment
2009-05-31 18:21:23 -05:00
Slava Pestov
e04df76f60
Various codegen improvements:
...
- new-insn word to construct instructions
- cache RPO in the CFG
- re-organize low-level optimizer so that MR is built after register allocation
- register allocation now stores instruction numbers in the instructions themselves
- split defs-vregs into defs-vregs and temp-vregs
2009-05-29 13:11:34 -05:00
Doug Coleman
407377fc98
rename peek -> last and update all usages
2009-05-25 16:38:33 -05:00
Slava Pestov
05f3f9dcb9
Fixing unit tests for stack effect inference changes
2009-04-20 21:15:19 -05:00
Slava Pestov
37e278ed02
Use [ ] [ ] map-reduce instead of unclip [ ] reduce
2009-04-06 17:50:54 -05:00
Slava Pestov
421ee726b8
Merge branch 'master' into new_ui
2009-02-16 21:22:12 -06:00
Slava Pestov
6b25e99470
Add summary for heaps more vocabs
2009-02-16 21:05:13 -06:00
Slava Pestov
669548e62e
Clean up some usages of tuck, and add Joe's curried cleave/spread/apply combinators to kernel vocabulary
2009-02-02 13:43:54 -06:00
Slava Pestov
ca2f01e0d0
Updating non-core libraries for monotonic? change
2009-01-16 17:02:54 -06:00
Slava Pestov
34792a9f23
Remove >r/r>
2008-12-17 19:17:37 -06:00
Slava Pestov
c8521ad826
Add tool to dump live intervals
2008-11-04 17:23:20 -06:00
Slava Pestov
1af3b8ed65
If a register is spilled and the reload location is also a copy, we chicken out and don't coalesce. This is suboptimal but it's not clear to me how to implement it cleanly, and SSA graph coloring will solve this problem eventually anyway
2008-11-04 00:32:56 -06:00
Slava Pestov
0250d7c1d2
Forgot a drop in unit test
2008-11-03 01:53:27 -06:00
Slava Pestov
d11a779fdd
RicE
2008-11-02 03:58:32 -06:00
Slava Pestov
8df1aba71d
Coalescing
2008-11-02 01:49:57 -06:00
Slava Pestov
db4db19cd9
Start working on coalescing
2008-10-28 02:38:37 -07:00
Slava Pestov
ba0ed21e1d
Better error message
2008-10-22 21:58:37 -05:00
Slava Pestov
e92f795a76
More work on intrinsics; memory allocation and slot access now expands correctly
2008-10-20 20:40:15 -05:00
Slava Pestov
f092622fac
CFG IR is now pure SSA
2008-10-20 01:56:28 -05:00
Slava Pestov
14d8696f40
Oops, don't mix register classes in active set
2008-10-19 03:34:42 -05:00
Slava Pestov
c0d89b061e
Fixing register allocator prspilling
2008-10-19 01:10:21 -05:00
Slava Pestov
749c77d6b1
Fix linear scan test
2008-10-12 18:40:10 -05:00
Slava Pestov
cf46a832e7
Debugging register allocator and inline allocation
2008-10-08 23:42:53 -05:00
Slava Pestov
7b6d9c4c4f
Debugging new codegen
2008-10-07 20:00:38 -05:00
Slava Pestov
f436fd0c0f
Merging in new codegen
2008-10-07 16:16:50 -05:00