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
e21ca289c3
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
725280d424
Split off the notion of a register representation from a register class
2009-08-07 17:44:50 -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
9afa39aa3a
compiler.cfg.ssa.destruction: rename coalesce word to destruct-ssa
2009-07-28 12:56:33 -05:00
Slava Pestov
d10993b837
compiler.cfg: Rename ssa to ssa.construction, coalescing to ssa.destruction
2009-07-28 09:34:08 -05:00
Slava Pestov
80e10f1bd0
compiler.cfg: Fix some unit tests
2009-07-28 08:56:14 -05:00
Slava Pestov
13c3fdcb5c
compiler.cfg: Fixing test failures
2009-07-24 06:08:07 -05:00
Slava Pestov
e0f6d89ff1
compiler.cfg.value-numbering: insert ##copy instructions for instructions whose expressions simplify. While subsequent usages are replaced with the instruction computing the simplified vreg locally, global usages may exist of the original instruction. In this case, the ##copy is not dead
2009-07-24 05:30:30 -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
1aa6c9a0d5
compiler.cfg: Fix unit tests
2009-07-21 22:25:19 -05:00
Slava Pestov
e88e7f70be
Merge branch 'master' of git://factorcode.org/git/factor
2009-07-17 00:03:13 -05:00
Slava Pestov
3fb4fc1bde
Improve code generation for shift word: add intrinsics for fixnum-shift-fast in the case where the shift count is not constant, transform 1 swap shift into a more overflow check with open-coded fast case, transform bitand into fixnum-bitand in more cases
2009-07-16 23:50:48 -05:00
Daniel Ehrenberg
8477cf8e91
Phi elimination doesn't have the swap problem now
2009-07-16 22:42:13 -05:00
Slava Pestov
ebcd0dc252
compiler.cfg: Fix regressions from recent changes
2009-07-14 20:43:06 -05:00
Slava Pestov
11731f8d48
compiler.cfg.value-numbering: merge in compiler.cfg.branch-folding
2009-07-14 20:05:01 -05:00
Slava Pestov
73a2222541
compiler.cfg.value-numbering: branch folding
2009-07-14 19:17:12 -05:00
Slava Pestov
2ace87370e
compiler.cfg.value-numbering: more optimizations
2009-07-14 16:05:25 -05:00
Slava Pestov
d1eea090b6
compiler.cfg.value-numbering: add some unit tests
2009-07-14 13:25:07 -05:00
Slava Pestov
c860a3b1e6
compiler.cfg: update unit tests for compiler.cfg.comparisons
2009-07-14 12:06:55 -05:00
Slava Pestov
5ccf7bc99f
Merge branch 'master' of git://factorcode.org/git/factor
2009-07-13 22:59:19 -05:00
Doug Coleman
ccae9b59a4
clean up value numbering conversion of ##add/sub to ##add/sub-imm
2009-07-13 19:02:05 -05:00
Slava Pestov
768e2a5148
compiler.cfg: split off condition codes into a comparisons sub-vocabulary
2009-07-13 14:42:52 -05:00
Slava Pestov
3b244d5d41
compiler.cfg.value-numbering: fix ##compare and ##compare-branch rewrites
2009-07-13 12:33:58 -05:00
Slava Pestov
789d82745c
compiler.cfg.value-numbering: factor out value renaming into a separate compiler.cfg.renaming vocabulary
2009-07-09 23:14:26 -05:00
Slava Pestov
c0f1b2205a
compiler.cfg.value-numbering.rewrite: disable ##compare optimizations for now
2009-07-04 03:26:37 -05:00
Slava Pestov
fb488025aa
compiler.cfg.value-numbering.rewrite: fix ##compare-imm rewrite rule
2009-07-04 02:50:50 -05:00
Doug Coleman
cae8fed16c
convert ##compare with immediates to ##compare-imm
2009-07-03 19:19:33 -05:00
Doug Coleman
e7a227ad40
add constant folding for integer ops, refactor some rewrites
2009-07-02 19:03:21 -05:00
Doug Coleman
80eb5068e2
fix bug in rewriting #add -- wasn't checking small-enough?, and change negative adds to subtractions/negative subtractions to adds
2009-07-02 17:55:35 -05:00
Doug Coleman
86901eb01e
rewrite rules for add/sub/mul/and/or/xor-imm, rewrite load-immediate/add to be add-imm
2009-07-02 11:35:31 -05:00
Doug Coleman
04cb320c55
simplify sub and sub-imm
2009-07-02 11:33:15 -05:00
Doug Coleman
826464724e
add a utility word vreg>constant
2009-07-02 11:32:23 -05:00
Doug Coleman
ded1e29d2f
combine add-imm instructions into a single add
2009-06-30 22:59:53 -05:00
Slava Pestov
d558545b65
Remove obsolete optimization
2009-06-01 03:05:49 -05:00
Slava Pestov
3a9922d161
Fix compiler errors
2009-06-01 03:00:10 -05:00
Slava Pestov
692b479302
Split off local-optimization combinator into compiler.cfg.local, factor out CFG -> MR into compiler.cfg.mr, split off GC check insertion into a new compiler.cfg.gc-checks pass
2009-05-31 12:20:46 -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
Slava Pestov
76d74c16af
Fixing various bugs; alias analysis wasn't handling ##phi nodes, stack analysis incorrectly handled height-changing back edges and ##fixnum-*, clean up ##dispatch generation
2009-05-29 01:39:14 -05:00
Slava Pestov
117cb78d6b
Fixing local optimizations
2009-05-27 18:58:41 -05:00
Slava Pestov
ce25e0ad8d
New local-optimization combinator removes some boilerplate
2009-05-26 19:56:56 -05:00
Slava Pestov
1db81da264
Refactoring low-level optimizer to support stack analysis pass
2009-05-26 19:31:19 -05:00
Slava Pestov
7f766ab355
Update compiler tests for tag number changes
2009-04-28 21:43:30 -05:00
Slava Pestov
6b25e99470
Add summary for heaps more vocabs
2009-02-16 21:05:13 -06:00
Slava Pestov
44bfff7c7b
Rename ##load-indirect to ##load-reference since this is more descriptive; value numbering doesn't assign expressions to ##load-reference nodes since this would end up folding literals which were eq? but not =
2009-01-29 01:44:58 -06:00
Slava Pestov
4f0a9f311e
Untangling some dependencies
2008-12-08 14:58:00 -06:00
Slava Pestov
5634becda1
##fixnum-add, ##fixnum-sub instructions open-code overflow check
2008-11-28 05:33:58 -06:00
Slava Pestov
ab689c098b
Clean up direct literal code and make a first attempt at PowerPC support
2008-11-24 08:16:14 -06:00
Slava Pestov
eb05dd3a12
Optimize a ##dispatch that is applied to the result of a ##sub-imm or ##add-imm; this eliminates an instruction from the common 1 fixnum-fast { ... } dispatch and 8 fixnum-fast { ... } dispatch code sequences appearing in generic word expansions
2008-11-13 04:16:08 -06:00
Slava Pestov
64cbf619a9
Add more algebraic simplifications: comparison of a comparison, comparison where first is immediate
2008-11-06 09:27:52 -06:00