Commit Graph

842 Commits (6aef0184d90f76483d9e06ab359ee6c448d4a4df)

Author SHA1 Message Date
Philipp Brüschweiler 3dc33b67a9 various doc fixes 2009-08-11 16:58:47 +02:00
Slava Pestov 7956e63fc2 compiler.tree.propagation: be more careful with intervals, ensuring that the inferred interval of a value is a subset of the value class's interval. This improves accuracy, for example [ >fixnum 1 + >fixnum most-positive-fixnum <= ] constant-folds to true 2009-08-10 01:16:49 -05:00
Slava Pestov 55d1b76ad7 compiler.tree.escape-analysis: if the output of an #introduce node has an immutable tuple class type declaration, and it is not passed to any subroutine calls, or returned from the word, then unbox it. This speeds up vector arithmetic words on specialized arrays, because the specialized array is unboxed up-front, eliminating an indirection on every loop iteration 2009-08-09 16:29:21 -05:00
Slava Pestov 12ab2b9e9d _gc instruction doesn't need slot to hold GC root area size, since that's just tagged-values>> length 2009-08-09 03:08:13 -05:00
Slava Pestov ca2d989547 compiler.cfg.linearization: change order to fit older unit tests 2009-08-08 23:06:57 -05:00
Slava Pestov 638f5b6579 More accurate interval inference for mod, rem, and propagation can now infer intervals in the case where a value might be f. so, [ [ 127 bitand ] [ drop f ] if dup [ 0 >= ] [ not ] if ] now constant-folds down to 't'! 2009-08-08 23:03:45 -05:00
Slava Pestov 26531ddf8b More accurate interval-mod and interval-rem 2009-08-08 22:01:12 -05:00
Slava Pestov f3903e2ac3 compiler.cfg.two-operand: sometimes we can eliminate a copy in the x = y <op> y case 2009-08-08 20:03:42 -05:00
Slava Pestov 38ef8adde0 compiler.cfg.representation: OK to unbox output of ##load-reference globally 2009-08-08 20:03:13 -05:00
Slava Pestov 88d15dfbea 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 0eebb20780 compiler.cfg.ssa.liveness: fix tests 2009-08-08 16:15:45 -05:00
Slava Pestov 4d289e0844 compiler.cfg.representations: emit-conversion should not be private since CSSA construction uses it 2009-08-08 04:13:30 -05:00
Slava Pestov 2d575d7ec9 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 4921b819e0 compiler.cfg.representations: new pass to make global unboxing decisions, relies on new compiler.cfg.loop-detection pass for loop nesting information 2009-08-08 00:24:46 -05:00
Slava Pestov 4d2160799f Split off the notion of a register representation from a register class 2009-08-07 17:44:50 -05:00
Slava Pestov 8b887630a0 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 6ce9bcc658 compiler.graphviz: add high-level IR call graph rendering 2009-08-05 03:33:06 -05:00
Slava Pestov b22a530511 compiler.tree.recursive: have to check tail call flag of call tree edges too 2009-08-05 02:14:49 -05:00
Slava Pestov a2f52c1e41 compiler.tree.recursive: more accurate loop detection 2009-08-04 19:18:40 -05:00
Slava Pestov 4b87ee4ebd compiler.tree.recursive: add some more more loop detection tests 2009-08-04 16:23:14 -05:00
Slava Pestov 7c3d65af21 Merge branch 'master' of git://factorcode.org/git/factor 2009-08-03 10:31:27 -05:00
Slava Pestov 41a444a3d4 compiler.cfg.critical-edges: no longer neededed 2009-08-03 10:31:00 -05:00
Slava Pestov cffd809ca0 compiler.cfg.stacks: more accurate deconcatenatization inserts fewer partially redundant ##peeks. 11% improvement on benchmark.beust2, 2% reduction in ##peek and ##replace instructions inserted 2009-08-03 07:08:28 -05:00
Slava Pestov e683004434 compiler.cfg.stacks.uninitialized: use bitand instead of min 2009-08-03 06:03:38 -05:00
Joe Groff 09b2acbd10 Merge branch 'master' of git://factorcode.org/git/factor 2009-08-02 23:16:52 -05:00
Joe Groff b4befe3f69 [ [ ... ] compare ] sort => [ ... ] sort-with 2009-08-02 20:09:23 -05:00
Slava Pestov 5b6e0ce534 compiler.cfg.def-use: remove compute-def-use word, passes have to call compute-defs or compute-uses now; compiler.cfg.ssa.liveness: don't compute dominance and def-use first since destruction does already 2009-08-02 19:12:32 -05:00
Slava Pestov a61037d8f7 Merge branch 'master' of git://factorcode.org/git/factor 2009-08-02 18:46:27 -05:00
Slava Pestov c29ee06adb Revert "SSA destruction uses new SSA liveness checking"
This reverts commit 98c7de8410.
2009-08-02 18:41:31 -05:00
Slava Pestov b3786fb6eb Revert "compiler.cfg.liveness.ssa: remove"
This reverts commit 6144fee101.
2009-08-02 18:41:16 -05:00
Daniel Ehrenberg d643a0de21 Merge branch 'master' of git://factorcode.org/git/factor 2009-08-02 18:25:37 -04:00
Daniel Ehrenberg 4e65589361 Merge branch 'master' of git://factorcode.org/git/factor
Conflicts:

	basis/compiler/cfg/ssa/liveness/liveness-tests.factor
2009-08-02 18:23:49 -04:00
Slava Pestov 6144fee101 compiler.cfg.liveness.ssa: remove 2009-08-02 17:19:01 -05:00
Daniel Ehrenberg 318018f999 Removing phi-outs set in SSA liveness checking 2009-08-02 18:15:18 -04:00
Slava Pestov 8a631dfbd9 Merge branch 'master' of git://factorcode.org/git/factor 2009-08-02 17:07:06 -05:00
Slava Pestov 3104129127 compiler.cfg.ssa.liveness: fix unit tests 2009-08-02 17:06:35 -05:00
Daniel Ehrenberg 82ba9a2e0c minor SSA liveness code reorganization 2009-08-02 18:05:51 -04:00
Daniel Ehrenberg 98c7de8410 SSA destruction uses new SSA liveness checking 2009-08-02 18:04:45 -04:00
Daniel Ehrenberg 5c6f0413eb def-use puts phi uses in respective predecessors 2009-08-02 18:04:07 -04:00
Slava Pestov 85b6b4c052 compiler.cfg.ssa.destruction: add optimization from old destruction pass: don't run on CFGs that have no phi instructions 2009-08-02 10:57:27 -05:00
Slava Pestov 929f195076 compiler.cfg.ssa.interference: cleanup 2009-08-02 10:35:02 -05:00
Slava Pestov 00254d1bde compiler.cfg.ssa.destruction: new implementation: simpler and more correct 2009-08-02 10:26:52 -05:00
Slava Pestov 7665784911 Compiler speedups 2009-08-02 09:16:21 -05:00
Slava Pestov d17d00595e compiler.cfg.ssa.destruction.copies: factor out add-instructions combinator into compiler.cfg.utilities 2009-08-02 08:20:50 -05:00
Slava Pestov ea7ba75a7f Move compiler.cfg.ssa.destruction.interference to compiler.cfg.ssa.interference 2009-08-02 08:15:36 -05:00
Slava Pestov b90e2c92f0 compiler.cfg.ssa.destruction.interference: fix a bug and add unit tests 2009-08-02 08:11:30 -05:00
Slava Pestov 1d289e68a4 compiler.cfg.debugger: fix load error 2009-08-02 08:11:04 -05:00
Slava Pestov d84216ce6c compiler.cfg.ssa.destruction: add some unit tests 2009-08-02 06:17:44 -05:00
Slava Pestov ebe70b3bb1 compiler.cfg.critical-edges: update ##phi nodes 2009-08-02 06:17:22 -05:00
Slava Pestov 64b719269f compiler.cfg.utilities: add each-phi combinator to iterate over all ##phi instructions in a basic block 2009-08-02 06:16:58 -05:00
Slava Pestov 3a9e164275 compiler tests: add test case for coalescing bug 2009-08-02 03:49:54 -05:00
Slava Pestov 8028eb5776 compiler.cfg: clean up unit tests using some new utilities 2009-08-02 03:49:25 -05:00
Slava Pestov c89cb4e3ca compiler.cfg.two-operand: if last instruction in a basic block is an overflowing arithmetic op of the form x = y op x, we now convert it correctly. This fixes compiler regression with benchmark.dawes after recent coalescing changes 2009-08-01 23:50:47 -05:00
Slava Pestov 49ac00097e compiler.tree.propagation.call-effect: fix case where quotation inlining could enter an infinite loop: [ dup call( quot -- ) ] dup call( quot -- ) etc 2009-08-01 23:34:14 -05:00
Slava Pestov 87a5ea36d1 compiler.cfg.copy-prop: eliminate phi nodes that have the same inputs as a previous phi node in the basic block 2009-08-01 22:33:27 -05:00
Slava Pestov eeea7f019d Merge branch 'master' of git://factorcode.org/git/factor 2009-08-01 20:22:51 -05:00
Slava Pestov bb1c904261 compiler.cfg.ssa.destruction: fix bug in trivial-interference heuristic, and type error in code path that didn't run before 2009-08-01 20:22:31 -05:00
Daniel Ehrenberg 56f6f4d0ce Merge branch 'master' of git://factorcode.org/git/factor 2009-08-01 20:33:41 -04:00
Slava Pestov 7ee7346505 compiler.cfg.liveness.ssa: fix bad bug discovered by littledan 2009-08-01 18:54:24 -05:00
Slava Pestov 86f8445eb6 compiler.cfg.stacks: kill set now includes all locations eliminated as a result of stack height decrease; reduces number of ##replace instructions generated by 2% 2009-08-01 06:12:43 -05:00
Slava Pestov 14d8cc4e5e compiler: Oops, typos in unit tests 2009-07-31 22:33:02 -05:00
Slava Pestov a5c4877bf6 compiler.cfg.ssa.destruction: fix bug in renaming triggered by sequence-parser:take-sequence 2009-07-31 18:34:15 -05:00
Slava Pestov db55a031df Move a bunch of GC check generation logic to platform-independent side 2009-07-30 21:28:27 -05:00
Daniel Ehrenberg 76a5972a69 Faster SSA liveness testing 2009-07-30 15:23:47 -04:00
Slava Pestov 99216b8435 compiler.cfg: Get inline GC checks working again, using a dataflow analysis to compute uninitialized stack locations in compiler.cfg.stacks.uninitialized. Re-enable intrinsics which use inline allocation 2009-07-30 09:19:44 -05:00
Slava Pestov 8677d56466 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 8ae9c4477a compiler.cfg.ssa.destruction: fix 2009-07-29 23:43:00 -05:00
Slava Pestov 0d42e0fc1e compiler.cfg.ssa.destruction: tweak in preparation for landing Dan's new SSA liveness analysis 2009-07-29 23:35:51 -05:00
Slava Pestov c815c8c5b5 compiler.cfg.linear-scan: more test fixes 2009-07-29 07:04:52 -05:00
Slava Pestov 5ecd0d91a3 compiler.cfg: remove 'regs' slot from instruction tuples now that register allocation doesn't use it anymore 2009-07-29 06:50:46 -05:00
Slava Pestov bd70967f8a compiler.cfg.linear-scan.resolve: fix unit tests to not depend on hashing 2009-07-29 06:48:01 -05:00
Slava Pestov f260500bcd compiler: fix test 2009-07-29 06:39:54 -05:00
Slava Pestov 68d06c4b06 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 02b1cc0c40 compiler.cfg.linear-scan.assignment: more efficient data structures 2009-07-29 06:12:33 -05:00
Slava Pestov 6e56e08012 compiler.cfg.linearization: fix bootstrap 2009-07-28 22:52:07 -05:00
Slava Pestov 89039e9977 Merge branch 'master' of git://factorcode.org/git/factor 2009-07-28 21:31:25 -05:00
Slava Pestov c634f5a9a0 compiler.cfg.linearization: rotate loops. 2x speedup with empty times loop, 1.5x speedup on benchmark.dawes 2009-07-28 21:31:08 -05:00
Slava Pestov ac7447483d compiler.cfg.ssa.destruction: rename coalesce word to destruct-ssa 2009-07-28 12:56:33 -05:00
Slava Pestov bbd4e4af3e 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 a2ae560a8a compiler.cfg.ssa.construction: use the optimization from the pruned-SSA paper to minimize stack pushing and popping 2009-07-28 11:52:42 -05:00
Slava Pestov 2a87faf681 IN: fix for compiler test 2009-07-28 11:16:21 -05:00
Slava Pestov 31caa7af2f compiler.cfg.ssa.construction: Use TDMSC algorithm to compute Phi placement 2009-07-28 11:16:10 -05:00
Slava Pestov 7a158d84da compiler.cfg: Rename ssa to ssa.construction, coalescing to ssa.destruction 2009-07-28 09:34:08 -05:00
Slava Pestov 905f52d4a9 compiler.cfg: Fix some unit tests 2009-07-28 08:56:14 -05:00
Slava Pestov 8f08ce94fa compiler.cfg.branch-splitting: re-enable with a better heuristic 2009-07-28 08:48:05 -05:00
Slava Pestov 91d2b3e805 compiler.cfg.utilities: add loop-entry? word 2009-07-28 08:47:50 -05:00
Slava Pestov 6d4a54201b compiler.cfg.linear-scan: fix resolve pass 2009-07-28 08:47:35 -05:00
Slava Pestov f61dff0d5e compiler.cfg.coalescing: cleanups 2009-07-28 08:47:03 -05:00
Slava Pestov 5d3a795e7d Revert "compiler.cfg.coalescing: some cleanups"
This reverts commit e5834c4ba7.
2009-07-28 07:51:44 -05:00
Slava Pestov c44b13c29e compiler.cfg.linear-scan.resolve: unit tests 2009-07-28 07:41:41 -05:00
Slava Pestov 3fc36e3750 compiler.cfg.utilities: fix stack effect declaration 2009-07-28 07:40:09 -05:00
Slava Pestov f19ee61d3a compiler.cfg.linear-scan: use compiler.cfg.parallel-copy in resolve pass 2009-07-28 07:39:46 -05:00
Slava Pestov e5834c4ba7 compiler.cfg.coalescing: some cleanups 2009-07-28 07:37:50 -05:00
Slava Pestov e6bdd27c2e compiler.cfg.utilities: fix load error 2009-07-28 06:51:03 -05:00
Slava Pestov 496d59d86c compiler.cfg.coalescing: Only run if CFG has ##phi nodes, fix interference for case where value is not used in a block and is not live-in, forgot to run liveness analysis first 2009-07-28 06:48:20 -05:00
Slava Pestov 8ac396d9e0 Add some compiler tests 2009-07-28 06:45:31 -05:00
Slava Pestov 2fe741568c compiler.cfg.liveness: fix liveness computation in case where instruction uses a register it defines 2009-07-28 06:45:02 -05:00
Slava Pestov 3550880850 compiler.cfg.critical-edges: reset RPO 2009-07-28 01:04:13 -05:00
Slava Pestov 164e5c4eb5 Add some tests that directly generate low level IR 2009-07-27 22:29:33 -05:00
Slava Pestov 536dc1c014 compiler.cfg.coalescing: precompute live intervals, add support for instructions where output cannot equal an input, split critical edges 2009-07-27 22:29:17 -05:00