Joe Groff
2625f2d210
Merge branch 'master' of git://factorcode.org/git/factor
2009-09-30 11:35:40 -05:00
Joe Groff
cb646db54a
add a "test-mr." word to compiler.cfg.debugger equivalent to "test-mr mr."
2009-09-30 11:34:19 -05:00
Slava Pestov
b677822b76
compiler.cfg.value-numbering: fix overly-zealous ##compare-imm conversion
2009-09-30 05:09:20 -05:00
Slava Pestov
cdc7b7e2c7
Various minor compiler tweaks: Combine address calculation with dereferencing in alien accessors; convert SIMD XOR of a vector with itself into an XOR of the destination with itself; convert SIMD unbox of zero vector into XOR of the destination with itself; fix SIMD indexing on x86-64
2009-09-30 05:00:36 -05:00
Slava Pestov
1da18d06b1
compiler.cfg.value-numbering: add some more rewrite rules, neg/neg, not/not, and a few for SIMD
2009-09-30 02:18:29 -05:00
Slava Pestov
80e84a357d
math.vectors.simd: add vbroadcast intrinsic, fix integer overflow issues
2009-09-29 22:58:20 -05:00
Slava Pestov
810cd7b4bb
compiler.cfg.ssa.destruction: don't coalesce registers with different representations, even if they're in the same register class, since this messes up spilling
2009-09-29 22:28:20 -05:00
Slava Pestov
f395d83379
math.vectors.simd: add fast intrinsic for 'nth', replace broadcast primitive with shuffles
2009-09-29 04:48:11 -05:00
Slava Pestov
e40a95c1e1
math.vectors.simd: add vshuffle intrinsic
2009-09-28 23:12:13 -05:00
Slava Pestov
a8ea929ad9
Work in progress
2009-09-28 17:31:34 -05:00
Slava Pestov
08a2eb74f4
cpu.x86: shifts didn't work if dst != src1; re-organize file a bit
2009-09-28 05:39:53 -05:00
Slava Pestov
da5f0d0a14
compiler.cfg.ssa.destruction: we can coalesce two registers with different representations as long as they both belong to the same register class
2009-09-28 03:24:54 -05:00
Slava Pestov
b2ea3afd84
math.vectors.simd: add hlshift, hrshift (128-bit shift), vbitandn intrinsics
2009-09-28 02:17:46 -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
59fbe85c9b
compiler.cfg: nuke ##bignum>integer and ##integer>bignum since they were unused
2009-09-27 20:36:05 -05:00
Slava Pestov
66071f45a3
Add a couple more def-is-use instructions
2009-09-27 20:34:20 -05:00
Slava Pestov
f757b454cc
Merge branch 'master' into more_aggressive_coalescing
2009-09-27 19:29:50 -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
1e841e5086
compiler.cfg.ssa.destruction: more aggressive coalescing work in progress
2009-09-27 17:17:26 -05:00
sheeple
01a4047126
Merge branch 'slots' of git://factorcode.org/git/factor into slots
...
Conflicts:
basis/cpu/x86/x86.factor
2009-09-26 03:12:42 -05:00
Daniel Ehrenberg
51f2bbd74b
Completing slot and set-slot changes on x86
2009-09-26 01:39:48 -05:00
Daniel Ehrenberg
7bd330cfd5
Making ##slot and ##set-slot not have a temporary parameter
2009-09-26 00:28:14 -05:00
Slava Pestov
c0abb9ce95
hints: fix regression with declarations
2009-09-25 18:50:08 -05:00
Slava Pestov
bbbb207dab
Some fixes and cleanups in math.vectors
...
- Tighten up type inference for operations on complex float arrays
- Fix v. to have correct behavior with complex numbers
- Rename v<< and v>> to vlshift and vrshift to avoid clashing with v>> accessor
2009-09-24 06:58:33 -05:00
Slava Pestov
cb497f009b
Merge branch 'vm_cleanup' of git://github.com/phildawes/factor
2009-09-24 04:31:55 -05:00
Slava Pestov
7b6128dd03
math.vectors.simd: add v<< and v>> intrinsics for bitwise shifts on elements
2009-09-24 03:32:39 -05:00
Phil Dawes
84faf2431f
cleaned up vm-field-ptr compiler code
2009-09-24 08:16:57 +01:00
Slava Pestov
9f59f6b9c6
Merge branch 'master' into integer-simd
2009-09-23 02:48:38 -05:00
Slava Pestov
7d39499d86
compiler.cfg.ssa.cssa: correctly handle overflowing fixnum instructions
2009-09-23 02:47:56 -05:00
Slava Pestov
43fa252af5
math.vectors.simd: new operations: vabs vsqrt vbitand vbitor vbitxor
2009-09-23 02:47:14 -05:00
Slava Pestov
d23826906f
Merge branch 'master' into integer-simd
2009-09-22 20:21:40 -05:00
Slava Pestov
0e3a261637
Fix test failures in compiler.cfg.linearization.order, compiler.tests.low-level-ir and compiler.graphviz
2009-09-22 05:07:52 -05:00
Slava Pestov
629fd1fc82
Merge branch 'master' into integer-simd
2009-09-22 03:24:52 -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
9d90bdd439
Fix conflict
2009-09-20 23:18:07 -05:00
Slava Pestov
ea44ea3522
math.vectors.simd: add saturated arithmetic operations
2009-09-20 23:16:02 -05:00
Slava Pestov
acea55c692
math.vectors: add v+- word which is accelerated by SSE3
2009-09-20 17:43:16 -05:00
Phil Dawes
ff8f2b10ec
fixed up getenv compiler intrinsic to use vm struct userenv
2009-09-16 08:16:32 +01:00
Joe Groff
4d16c569f0
struct classes now make their own C type without help from alien.structs. remove alien.structs dependencies from everywhere outside of alien and compiler, and have the FFI handle both alien.structs and classes.struct c-types
2009-09-15 17:38:49 -05:00
Slava Pestov
4f702de449
math.functions: more accurate log10 (fixes problem reported by OneEyed)
2009-09-14 16:19:58 -05:00
Slava Pestov
a2de9d9e54
compiler.cfg.builder: don't run certain tests if float intrinsics are not available
2009-09-13 23:12:47 -05:00
Slava Pestov
32b95c2cdf
math: add unordered comparison operators u< u<= u> u>= which behave exactly like < <= > >= except no floating point exceptions are set if one or both inputs are NaNs; also add efficient intrinsic for unordered? predicate, and fix propagation type functions for abs, absq, and bitnot
2009-09-12 22:20:13 -05:00
Slava Pestov
86a848bae6
compiler.cfg.intrinsics: compile float-mod as a ##binary-float-function instead of a primitive call
2009-09-11 21:00:17 -05:00
Slava Pestov
daff63071f
Fix the build
2009-09-09 13:44:54 -05:00
Slava Pestov
15d85c1c4f
compiler.cfg.save-contexts: add new pass
2009-09-08 21:56:28 -05:00
Slava Pestov
7e2f0e5dbf
compiler: separate ##save-context instruction from ##alien-invoke, generate a ##save-context for libm calls, and add a pass to combine multiple context saves within a basic block. Fixes crashes with FP traps thrown by libm functions on x86-32
2009-09-08 21:50:55 -05:00
Joe Groff
0ea9949e51
split unordered and ordered float comparison intrinsics in compiler; generate only unordered comparisons for now
2009-09-08 17:04:26 -05:00
Slava Pestov
bbca00e2ae
Fix conflicts
2009-09-07 23:51:25 -05:00
Slava Pestov
7c04b912bb
compiler.cfg.value-numbering: update tests for Joe's condition code changes
2009-09-04 03:11:56 -05:00
Slava Pestov
4a2823b2eb
compiler: tweak generated code
2009-09-04 03:01:18 -05:00
Slava Pestov
e11d1e37f5
math.vectors.simd: allow punning SIMD vectors between types
2009-09-04 02:35:58 -05:00
Slava Pestov
c92e54b560
compiler.cfg.intrinsics: fix type detection on the alien type for vector accessors
2009-09-04 02:22:54 -05:00
Slava Pestov
e36a0d7ef4
compiler: clean up code generation for alien boxing/unboxing a bit
2009-09-03 21:22:43 -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
Joe Groff
036ff77306
add compiler comparison codes for floating-point unordered comparisons; update x86 backend to generate proper code for all floating-point comparisons
2009-09-03 20:32:05 -05:00
Slava Pestov
bf81cb4259
math.vectors.simd: split off intrinsics into a sub-vocabulary, to avoid loading most of the SIMD code on bootstrap
2009-09-03 03:43:43 -05:00
Slava Pestov
ff8c70dbe0
Initial implementation of SSE vector intrinsics:
...
- cpu.architecture: add SSE vector representations
- compiler.cfg.intrinsics.alien: remove an attempt at optimization that value numbering handles now
- compiler.cfg.representations: support instructions where the representation is set in the 'rep' slot, and support conversions between single and double floats
- alien-float, set-alien-float now use the single float representation, and the conversion is implicit; this fixes a long-standing bug where a register could get clobbered because of how %set-alien-float was defined on x86
- math.vectors.specialization: add support for SIMD specialization (where the vector word's body is replaced by another quotation), also specialize the 'sum' word
- math.vectors.simd: 4float-array, 2double-array, 4double-array types, and specializers for the math.vectors words
2009-09-03 02:33:07 -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
f91b539c31
cpu.ppc: implement fast float function calls; 3x speedup on benchmark.struct-arrays on PowerPC
2009-09-01 15:19:26 -05:00
Slava Pestov
868009aaee
compiler.cfg.intrinsics: cleanup: the "intrinsic" word property is now a quotation, not a boolean, making this mechanism more extensible
2009-08-30 22:20:49 -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
9595be4bf9
%box-displaced-alien: fix clobberage found by Doug
2009-08-30 05:11:08 -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
908b4742c5
compiler.cfg.value-numbering: fix ##box-displaced-alien simplification
2009-08-28 19:05:49 -05:00
Slava Pestov
2bb6293217
compiler: add fixnum-min/max intrinsics; ~10% speedup on benchmark.yuv-to-rgb
2009-08-28 19:02:59 -05:00
Slava Pestov
d957ae4e44
Performance improvements to make struct-arrays benchmark faster
...
- improved optimization of ##unbox-any-c-ptr on ##box-displaced-alien; convert it to ##unbox-c-ptr where possible using class info stored in the ##bda instruction
- make fcos, fsin, etc inline again; everything in math.libm inline again, except for fsqrt which is an intrinsic
- convert min and max on floats to float-min and float-max
- make min and max not inline, so that the above can work
- struct-arrays: rice a bit so that more fixnums come up
2009-08-28 05:21:16 -05:00
Slava Pestov
8f19f14c1f
compiler.cfg.instructions: forgot that ##box-displaced-alien needs a GC check; fixes segfault in benchmark.mandel
2009-08-27 04:09:35 -05:00
Slava Pestov
f662e6403a
compiler: new inline intrinsic for <displaced-alien> where the inputs have known types; value numbering now eliminates unnecessary allocation of displaced aliens if the result is immediately unboxed again
2009-08-27 00:06:19 -05:00
Slava Pestov
8bf709acd0
compiler.cfg.linear-scan: fix unit tests for new fake-representations
2009-08-26 08:58:00 -05:00
Slava Pestov
8d55616d34
compiler.cfg.debugger: fix fake-representations so that low-level-ir tests can pass on x86
2009-08-25 23:44:01 -05:00
Slava Pestov
0df8aadce2
cpu.x86: use SQRTSD instruction for math.libm:fsqrt word
2009-08-25 23:22:15 -05:00
Slava Pestov
81b72cb5c5
Add some unit tests
2009-08-22 17:15:10 -05:00
Slava Pestov
5197aca215
compiler.cfg.dataflow-analysis: when intersecting sets, treat uninitialized sets as universal rather than empty; reduces number of stack instructions generated by 1%
2009-08-20 18:15:41 -05:00
Slava Pestov
fd2f0a602d
compiler.cfg.stacks.local: more accurate local replace set computation; optimizes out 'swap swap'
2009-08-19 22:00:21 -05:00
Slava Pestov
a598cc35a5
compiler: add unit tests for new bugs
2009-08-19 16:56:26 -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
Daniel Ehrenberg
8197d9356b
Write barriers are hoisted out of loops when their target is slot-available
2009-08-13 20:26:44 -05:00
Doug Coleman
2ed4425b7a
Merge branch 'master' of git://factorcode.org/git/factor
...
Conflicts:
basis/calendar/calendar.factor
2009-08-13 19:40:02 -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
Daniel Ehrenberg
5a3e350490
Global write barrier elimination tracks newly allocated objects
2009-08-13 15:18:47 -05:00
Daniel Ehrenberg
d35e1eb76c
Fixing write-barrier elimination; adding bb as a parameter to join-sets in dataflow analysis
2009-08-12 23:52:29 -05:00
Daniel Ehrenberg
1a7ab59f56
Making write barrier elimination global
2009-08-11 21:21:21 -05:00
Slava Pestov
8a9c15ab0b
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
cc5476c823
_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
687454878a
compiler.cfg.linearization: change order to fit older unit tests
2009-08-08 23:06:57 -05:00
Slava Pestov
24a50c8006
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
55acddef3f
compiler.cfg.representation: OK to unbox output of ##load-reference globally
2009-08-08 20:03:13 -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
11dc0a23a8
compiler.cfg.ssa.liveness: fix tests
2009-08-08 16:15:45 -05:00
Slava Pestov
1bf8a0cac7
compiler.cfg.representations: emit-conversion should not be private since CSSA construction uses it
2009-08-08 04:13:30 -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
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
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
b49e4c9c9b
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-03 10:31:27 -05:00
Slava Pestov
d286a7f426
compiler.cfg.critical-edges: no longer neededed
2009-08-03 10:31:00 -05:00
Slava Pestov
d20d335447
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
720bfe378f
compiler.cfg.stacks.uninitialized: use bitand instead of min
2009-08-03 06:03:38 -05:00
Joe Groff
63e5b0d6d8
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-02 23:16:52 -05:00
Joe Groff
7c5ef08aab
[ [ ... ] compare ] sort => [ ... ] sort-with
2009-08-02 20:09:23 -05:00
Slava Pestov
dac7edd2ab
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
df6c87d350
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-02 18:46:27 -05:00
Slava Pestov
32d9102feb
Revert "SSA destruction uses new SSA liveness checking"
...
This reverts commit 98c7de8410
.
2009-08-02 18:41:31 -05:00
Slava Pestov
a15b20a671
Revert "compiler.cfg.liveness.ssa: remove"
...
This reverts commit 6144fee101
.
2009-08-02 18:41:16 -05:00
Daniel Ehrenberg
665b3921d1
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-02 18:25:37 -04:00
Daniel Ehrenberg
f7a53811c1
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
634e1dd525
compiler.cfg.liveness.ssa: remove
2009-08-02 17:19:01 -05:00
Daniel Ehrenberg
765efc1a66
Removing phi-outs set in SSA liveness checking
2009-08-02 18:15:18 -04:00
Slava Pestov
777bda70dc
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-02 17:07:06 -05:00
Slava Pestov
8a8ebcb908
compiler.cfg.ssa.liveness: fix unit tests
2009-08-02 17:06:35 -05:00
Daniel Ehrenberg
3b78d03e2a
minor SSA liveness code reorganization
2009-08-02 18:05:51 -04:00
Daniel Ehrenberg
cf7ab59fb7
SSA destruction uses new SSA liveness checking
2009-08-02 18:04:45 -04:00
Daniel Ehrenberg
d349cc565a
def-use puts phi uses in respective predecessors
2009-08-02 18:04:07 -04:00
Slava Pestov
73e7ead209
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
ba55633b19
compiler.cfg.ssa.interference: cleanup
2009-08-02 10:35:02 -05:00
Slava Pestov
82c1106945
compiler.cfg.ssa.destruction: new implementation: simpler and more correct
2009-08-02 10:26:52 -05:00
Slava Pestov
c1c8424605
Compiler speedups
2009-08-02 09:16:21 -05:00
Slava Pestov
8aa41672ca
compiler.cfg.ssa.destruction.copies: factor out add-instructions combinator into compiler.cfg.utilities
2009-08-02 08:20:50 -05:00
Slava Pestov
cff5976a0d
Move compiler.cfg.ssa.destruction.interference to compiler.cfg.ssa.interference
2009-08-02 08:15:36 -05:00
Slava Pestov
87e13db946
compiler.cfg.ssa.destruction.interference: fix a bug and add unit tests
2009-08-02 08:11:30 -05:00
Slava Pestov
7ec288b013
compiler.cfg.debugger: fix load error
2009-08-02 08:11:04 -05:00
Slava Pestov
b5a978d4e5
compiler.cfg.ssa.destruction: add some unit tests
2009-08-02 06:17:44 -05:00
Slava Pestov
c61b729125
compiler.cfg.critical-edges: update ##phi nodes
2009-08-02 06:17:22 -05:00
Slava Pestov
01f51a96cd
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
e1c7f7394a
compiler.cfg: clean up unit tests using some new utilities
2009-08-02 03:49:25 -05:00
Slava Pestov
9bde92220b
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
1ef9cd27d3
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
05b7bb0079
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-01 20:22:51 -05:00
Slava Pestov
20ec574965
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
0838beed1e
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-01 20:33:41 -04:00
Slava Pestov
76368cae9b
compiler.cfg.liveness.ssa: fix bad bug discovered by littledan
2009-08-01 18:54:24 -05:00
Slava Pestov
2d719534cf
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
d515715b0c
compiler.cfg.ssa.destruction: fix bug in renaming triggered by sequence-parser:take-sequence
2009-07-31 18:34:15 -05:00
Daniel Ehrenberg
8134d775a8
Faster SSA liveness testing
2009-07-30 15:23:47 -04:00
Slava Pestov
be363d1a5b
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
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
6274c0337a
compiler.cfg.ssa.destruction: fix
2009-07-29 23:43:00 -05:00
Slava Pestov
b133649edd
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
cb36a40dc4
compiler.cfg.linear-scan: more test fixes
2009-07-29 07:04:52 -05:00
Slava Pestov
cb7735ddf4
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
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
50bf6f52b4
compiler.cfg.linearization: fix bootstrap
2009-07-28 22:52:07 -05:00
Slava Pestov
eabaf9fc40
Merge branch 'master' of git://factorcode.org/git/factor
2009-07-28 21:31:25 -05:00
Slava Pestov
8c6b38533c
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
9afa39aa3a
compiler.cfg.ssa.destruction: rename coalesce word to destruct-ssa
2009-07-28 12:56: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
7d3b6892d5
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
62fe308776
compiler.cfg.ssa.construction: Use TDMSC algorithm to compute Phi placement
2009-07-28 11:16:10 -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
d394dd3c36
compiler.cfg.branch-splitting: re-enable with a better heuristic
2009-07-28 08:48:05 -05:00
Slava Pestov
ff81b055a5
compiler.cfg.utilities: add loop-entry? word
2009-07-28 08:47:50 -05:00
Slava Pestov
e6f5eab598
compiler.cfg.linear-scan: fix resolve pass
2009-07-28 08:47:35 -05:00
Slava Pestov
3edf4a2b75
compiler.cfg.coalescing: cleanups
2009-07-28 08:47:03 -05:00
Slava Pestov
cf26800dbd
Revert "compiler.cfg.coalescing: some cleanups"
...
This reverts commit e5834c4ba7
.
2009-07-28 07:51:44 -05:00
Slava Pestov
18717a449f
compiler.cfg.linear-scan.resolve: unit tests
2009-07-28 07:41:41 -05:00
Slava Pestov
009cfbfc8d
compiler.cfg.utilities: fix stack effect declaration
2009-07-28 07:40:09 -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
f2c8f2824a
compiler.cfg.coalescing: some cleanups
2009-07-28 07:37:50 -05:00
Slava Pestov
3e6e5278a4
compiler.cfg.utilities: fix load error
2009-07-28 06:51:03 -05:00
Slava Pestov
a4cb242396
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
1878b0dc32
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
d2b158c8e4
compiler.cfg.critical-edges: reset RPO
2009-07-28 01:04:13 -05:00
Slava Pestov
3cc71a1934
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
Slava Pestov
e8cf50ac3e
compiler.cfg.two-operand: make it work in more cases
2009-07-27 22:28:29 -05:00
Slava Pestov
423d2996fa
compiler.cfg.debugger: reset vreg counters
2009-07-27 22:28:13 -05:00
Slava Pestov
c5d7ed58a5
Debugging compiler.cfg.coalescing
2009-07-27 19:24:13 -05:00
Slava Pestov
1a765c38da
compiler.cfg.parallel-copy: fix algorithm
2009-07-27 16:54:47 -05:00
Slava Pestov
9fa71959b5
compiler.cfg.coalescing: fix shuffling bug
2009-07-27 03:58:01 -05:00
Slava Pestov
e112b0d70e
compiler.cfg.phi-elimination: no longer needed
2009-07-27 02:20:53 -05:00
Slava Pestov
ba696b68b8
compiler.cfg.coalescing: more or less complete, now needs debugging
2009-07-27 02:20:45 -05:00
Slava Pestov
a32cbdd231
compiler.cfg.coalescing: more work done
2009-07-27 00:31:21 -05:00
Slava Pestov
a5e5510615
compiler.cfg.coalescing: work in progress
2009-07-26 21:11:26 -05:00
Slava Pestov
e9935b6aad
compiler.cfg.copy-prop: remove ##phi nodes where all inputs are copy-equivalent
2009-07-26 21:11:02 -05:00
Slava Pestov
fc41140720
compiler.cfg.utilities: move value-info utilities to compiler.tree.propagation.info
2009-07-26 21:10:33 -05:00
Slava Pestov
1319d8e549
compiler.cfg.def-use: build def-use chains
2009-07-26 21:10:14 -05:00
Slava Pestov
2137c9cc79
compiler.cfg.dominance: add pre order and max pre order numbers; use them to implement dominates? check
2009-07-26 21:10:05 -05:00
Slava Pestov
053de0af40
compiler.cfg.copy-prop: work in progress
2009-07-24 19:56:21 -05:00
Slava Pestov
2fb0198d48
compiler.cfg.parallel-copy: forgot to add this
2009-07-24 19:46:33 -05:00
Slava Pestov
4624af75f4
compiler.cfg.phi-elimination: move some utilities from compiler.cfg.utilities here since that's the only place they get used
2009-07-24 16:45:31 -05:00
Slava Pestov
13c3fdcb5c
compiler.cfg: Fixing test failures
2009-07-24 06:08:07 -05:00
Slava Pestov
7068de6cd3
compiler.cfg.copy-prop: Global copy propagation
2009-07-24 05:30:46 -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
de73534424
compiler.cfg.write-barrier: simplify a little bit. It doesn't need to do copy propagation, since its a separate pass now
2009-07-24 05:29:28 -05:00
Slava Pestov
7590ad3574
compiler.cfg: introduce less temporaries when building CFG
2009-07-24 03:37:18 -05:00
Slava Pestov
2bea107202
compiler.cfg.builder: fix stack effect declaration
2009-07-23 21:24:15 -05:00
Slava Pestov
d947c61bd7
compiler.cfg.stacks: now performs online local DCN
2009-07-23 20:54:38 -05:00
Slava Pestov
b1afd4c491
compiler.cfg.linear-scan.mapping: simplify
2009-07-23 18:03:04 -05:00
Slava Pestov
747a2d72c8
compiler.cfg.empty-blocks: new pass to delete empty blocks, runs after phi elimination
2009-07-23 18:02:46 -05:00
Slava Pestov
93c58a8bb5
compiler.cfg.branch-splitting: now that we do SSA construction we can split branches with fixnum overflow ops (which have a live-out)
2009-07-23 18:02:29 -05:00
Slava Pestov
610c3b33c7
compiler.cfg.intrinsics: Disable inline allocation for now
2009-07-22 21:11:06 -05:00
Slava Pestov
69ded76c66
Fixing compiler tests
2009-07-22 21:10:50 -05:00
Slava Pestov
45c66b58af
compiler.cfg.dcn.rewrite: remove unused word
2009-07-22 19:18:12 -05:00
Slava Pestov
5559d77d05
compiler.cfg.checker: eliminate dead code before checking MR
2009-07-22 19:17:57 -05:00
Slava Pestov
d29c275089
compiler.cfg.builder: Fix construction of ##return instructions from #return-recursive nodes
2009-07-22 19:17:21 -05:00
Slava Pestov
091d2d07f2
Merge branch 'master' into dcn
2009-07-22 06:19:44 -05:00
Slava Pestov
995a96d7e4
compiler.cfg.dominance: fix unit tests
2009-07-22 06:19:31 -05:00
Slava Pestov
26a5d51d93
compiler.cfg.ssa: now builds pruned SSA form
2009-07-22 06:08:04 -05:00
Slava Pestov
d864214119
compiler.cfg.dominance: add algorithm for computing iterated dominance frontiers
2009-07-22 06:07:51 -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
31491df5f1
Removed unused code from compiler.cfg.def-use
2009-07-22 06:05:33 -05:00
Slava Pestov
44bcd258f6
Insert _loop-entry in linearization pass instead of in CFG builder, so that optimizations don't have to worry about it
2009-07-22 06:05:17 -05:00
Slava Pestov
1e5ce41364
Fix bootstrap
2009-07-22 03:26:27 -05:00
Slava Pestov
25c42d04fd
compiler.cfg: Fix conflicts after merging local optimization refactoring into DCN branch
2009-07-22 03:17:53 -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
55111bdc24
Merge branch 'master' into dcn
2009-07-22 02:07:08 -05:00
Slava Pestov
c105b033ef
Merge branch 'master' of git://factorcode.org/git/factor
2009-07-22 02:06:47 -05:00
Slava Pestov
e6a323dfaa
compiler.cfg.dataflow-analysis: iterative dataflow analysis framework
2009-07-22 02:06:35 -05:00
Slava Pestov
b39b0dd393
compiler.cfg.dcn.global: redo using compiler.cfg.dataflow-analysis
2009-07-22 02:05:40 -05:00
Slava Pestov
b869e1250c
compiler.cfg.stack-analysis: Out with the old, in with the new
2009-07-22 00:52:25 -05:00
Slava Pestov
86df665f78
Merge branch 'master' of git://factorcode.org/git/factor into dcn
2009-07-22 00:14:53 -05:00
Slava Pestov
1aa6c9a0d5
compiler.cfg: Fix unit tests
2009-07-21 22:25:19 -05:00
Slava Pestov
e49de006c4
compiler.cfg.dcn: Fixing various bugs, hook up with optimizer
2009-07-21 22:24:50 -05:00
Slava Pestov
cfb584ed8d
Merge branch 'master' into dcn
2009-07-21 17:51:22 -05:00
Slava Pestov
ead57fc5dd
compiler.cfg.registers: minor optimization
2009-07-21 17:49:44 -05:00
Slava Pestov
e7e5bee9a2
compiler.cfg.ssa: Cytron's SSA construction algorithm
2009-07-21 17:49:30 -05:00
Slava Pestov
802b4ffdf5
compiler.cfg.dcn: remove stores to stack locations above top of stack (these are never read again)
2009-07-21 17:46:09 -05:00
Slava Pestov
441c2bae2d
Merge branch 'master' into dcn
2009-07-21 03:08:42 -05:00
Slava Pestov
3136549f48
compiler.cfg.dominance: fix idom computation, compute dominator tree, compute dominance frontiers, add some tests
2009-07-21 03:02:45 -05:00
Slava Pestov
fd9a353fd6
Move conjoin-at from compiler.cfg.liveness to sets
2009-07-21 03:02:06 -05:00
Slava Pestov
e16acae2f5
compiler.cfg.dcn: flesh out rewrite pass
2009-07-21 01:24:19 -05:00
Slava Pestov
fdef772d67
compiler.cfg: if a block has an instruction that kills values it must be the only instruction in the block
2009-07-19 20:12:04 -05:00
Slava Pestov
0a95ddd105
compiler.cfg.dcn: Implement height tracking
2009-07-19 19:45:23 -05:00
Slava Pestov
605b37a949
compiler.cfg.builder: annotate calls with height changes, once again
2009-07-18 23:08:53 -05:00
Slava Pestov
ec1407bdae
compiler.cfg.dcn: starting work on deconcatenatization pass to replace compiler.cfg.stack-analysis
2009-07-18 22:27:42 -05:00
Slava Pestov
9cbd6c52a6
compiler.cfg.stack-analysis: fix outdated tests
2009-07-18 06:38:42 -05:00
Slava Pestov
32e4a97855
compiler.cfg.linear-scan: fix tests
2009-07-18 06:10:01 -05:00
Slava Pestov
343151fd62
compiler.tree.finalization: undo a change that resulted in a compile time regression
2009-07-18 03:33:24 -05:00
Slava Pestov
3ee68d1ff5
Disable fixnum>bignum and bignum>fixnum intrinsics since they're not very useful and they increase code size significantly
2009-07-18 01:07:43 -05:00
Slava Pestov
ea69566ddd
compiler.cfg.linear-scan: algorithmic optimizations
2009-07-18 00:14:39 -05:00
Slava Pestov
5061db2a48
compiler.cfg: Move tail call optimization to the end, compiler.tree: simplify finalization pass because of this
2009-07-17 22:57:28 -05:00
Slava Pestov
b83f27af74
compiler.cfg.builder: remove some dead code
2009-07-17 21:52:33 -05:00
Slava Pestov
43fab5b2ae
Remove some unnecessary work from stack-analysis pass
2009-07-17 18:39:41 -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
8ea2996438
Removing two unused words in compiler.cfg.two-operand
2009-07-16 22:59:38 -05:00
Daniel Ehrenberg
3ca5665ad6
Merge branch 'master' of git://factorcode.org/git/factor
2009-07-16 22:42:39 -05:00
Daniel Ehrenberg
8477cf8e91
Phi elimination doesn't have the swap problem now
2009-07-16 22:42:13 -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
685e32b091
compiler.cfg.stack-analysis: global optimization work in progress
2009-07-16 16:43:14 -05:00
Slava Pestov
fc0e0f1924
compiler.cfg.block-joining: relax join heuristic
2009-07-16 05:50:44 -05:00
Slava Pestov
884e41dd9c
compiler.cfg.linear-scan.live-intervals: remove bogus assertion
2009-07-16 02:42:01 -05:00
Slava Pestov
9f926ab88c
compiler.cfg.block-joining: join basic blocks connected by a single edge to improve effectiveness of local optimizations
2009-07-16 02:17:58 -05:00
Slava Pestov
ebcd0dc252
compiler.cfg: Fix regressions from recent changes
2009-07-14 20:43:06 -05:00
Slava Pestov
4ac74e9304
compiler.cfg.branch-splitting: don't split if there's one predecessor
2009-07-14 20:42:50 -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
a75d558b30
compiler.cfg.intrinsics.fixnum: don't generate -imm forms anymore since value numbering does it
2009-07-14 19:18:57 -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
d7aeae45be
compiler.cfg.branch-splitting: split blocks with successors
2009-07-13 10:44:08 -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
608fb054f2
compiler.cfg: Some code cleanups, update stack-analysis and phi-insertion to work on CFGs with critical edges
2009-07-12 22:22:46 -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
11347e784c
insn. doesn't print numbers
2009-07-10 03:05:45 -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
7edb2df01c
Merge branch 'master' of git://factorcode.org/git/factor
2009-07-09 23:14:45 -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
6810b922ee
compiler.cfg: move back-edge? word from stack-analysis to top-level vocab
2009-07-09 23:13:30 -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
bb701bed7e
Revert "Remove unused vocabulary" -- committed patch from the wrong machine
...
This reverts commit 04c3c15411
.
2009-07-09 19:50:15 -05:00
Slava Pestov
8008bfb1f9
Remove unused vocabulary
2009-07-09 19:10:36 -05:00
U-SLAVA-DFB8FF805\Slava
508b7272b5
compiler.cfg.optimizer: fix irrelevant test
2009-07-09 06:17:10 -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
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
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
Doug Coleman
cae8fed16c
convert ##compare with immediates to ##compare-imm
2009-07-03 19:19:33 -05:00
Slava Pestov
2c3b2a0b71
compiler.cfg.predecessors: delete dead predecessors from phi nodes
2009-07-03 18:45:03 -05:00
Doug Coleman
e7a227ad40
add constant folding for integer ops, refactor some rewrites
2009-07-02 19:03:21 -05:00
Doug Coleman
f11ba00667
Revert "fix a unit test so it's sure to overflow 64bit machines"
...
This reverts commit 88a545a215
.
2009-07-02 18:18:50 -05:00
Doug Coleman
559a77be43
fix a unit test so it's sure to overflow 64bit machines
2009-07-02 18:05:55 -05:00
Doug Coleman
2aade588ee
Merge branch 'master' of git://factorcode.org/git/factor
2009-07-02 18:01:58 -05:00
Doug Coleman
e11e3cf6d2
unit test to make sure adds are not optimized incorrectly
2009-07-02 18:01:00 -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
Slava Pestov
6d46bf623c
compiler.cfg.liveness: update for new ##phi node representation
2009-07-02 17:28:02 -05:00
Slava Pestov
90daf6d03d
compiler.cfg: change representation of ##phi nodes. The input slot of ##phi nodes is now an assoc mapping predecessors to values, rather than a sequence of values. This ensures that optimization which delete predecessors can be implemented
2009-07-02 17:10:50 -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
Slava Pestov
3a4916462b
compiler.cfg.dce: now performs three passes over the CFG to fix a phase ordering issue
2009-07-02 03:17:19 -05:00
Slava Pestov
513a600664
compiler.cfg.dce: minor renamings
2009-07-02 02:41:10 -05:00
Daniel Ehrenberg
392e313f05
Merge branch 'master' of git://factorcode.org/git/factor
2009-07-02 02:31:06 -05:00
Daniel Ehrenberg
fcfd7f01a3
Dead code elimination eliminates some dead allocations
2009-07-02 02:30:46 -05:00
Slava Pestov
2de41f01da
compiler.cfg.optimizer: enable branch folding
2009-07-02 01:05:59 -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
7e3fa45512
compiler.cfg.stack-analysis: fix unit tests for useless-blocks renaming and ##no-tco instruction
2009-06-30 23:17:33 -05:00
Slava Pestov
a3b21292b6
Merge branch 'master' of git://factorcode.org/git/factor
2009-06-30 23:07:36 -05:00
Slava Pestov
f894baf60e
compiler.cfg.optimizer: disable branch folding for now
2009-06-30 23:07:27 -05:00
Slava Pestov
72b6bef19d
compiler.cfg.builder: emit less crap after a #terminate node
2009-06-30 23:03:25 -05:00
Doug Coleman
8b728e0a8a
Merge branch 'master' of git://factorcode.org/git/factor
2009-06-30 23:02:04 -05:00
Doug Coleman
b1c7374175
optimize fixnum*fast and fixnum-shift-fast
2009-06-30 23:01:44 -05:00
Doug Coleman
ded1e29d2f
combine add-imm instructions into a single add
2009-06-30 22:59:53 -05:00
Slava Pestov
3385e50c43
compiler.cfg.branch-folding: fold away branches where both inputs are the same register. This results in 'push' being compiled slightly better
2009-06-30 22:43:32 -05:00
Slava Pestov
fc595a7075
Fix possible infinite loop in skip-empty-blocks and remove redundant test in compiler.cfg.useless-conditionals
2009-06-30 22:43:02 -05:00
Slava Pestov
f412bbc6d6
Change branch splitting around a bit, rename useless-blocks to useless-conditionals and rewrite it
2009-06-30 22:11:15 -05:00
Slava Pestov
eb7f50adf4
Fix conflict
2009-06-30 21:37:49 -05:00
Slava Pestov
0402790001
compiler.cfg Remove height tracking for ##call instructions, wire in ##no-tco instruction
2009-06-30 21:21:46 -05:00
Slava Pestov
3da560130a
compiler.cfg.tco: fix tail call optimization for ##fixnum-mul
2009-06-30 21:08:08 -05:00
Slava Pestov
eca718b32d
compiler.cfg.builder: fix stack effect
2009-06-30 21:07:55 -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
1acf243cce
Fix conflict
2009-06-30 20:16:09 -05:00
Slava Pestov
5c6c3ecd85
compiler.cfg.tco: Tail call optimization moved out of compiler.cfg.builder into its own pass
2009-06-30 20:13:35 -05:00
Doug Coleman
2cd202d175
remove duplicate using
2009-06-30 18:48:52 -05:00
Doug Coleman
357408df3e
Merge branch 'master' of git://factorcode.org/git/factor
2009-06-30 18:48:10 -05:00
Doug Coleman
97cd0d584e
make commutative operations with immediates output the same IR
2009-06-30 18:47:24 -05:00
Slava Pestov
bc2a6c0ecc
compiler.cfg.stack-analysis: fix tests
2009-06-30 18:22:54 -05:00
Slava Pestov
d199154179
Merge branch 'master' of git://factorcode.org/git/factor
2009-06-30 18:12:00 -05:00
Slava Pestov
3355fa4809
compiler.cfg.stack-analysis: enable global optimization
2009-06-30 18:11:45 -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
Doug Coleman
ede8e1ca30
Merge branch 'master' of git://factorcode.org/git/factor
2009-06-30 15:32:11 -05:00
Doug Coleman
ea072731d4
add branch splitting pass to compiler.cfg
2009-06-30 15:31:48 -05:00
Slava Pestov
32738dddde
compiler.cfg.stack-analysis: fix typos in unit tests
2009-06-29 16:37:40 -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
Slava Pestov
6e72cf9711
compiler.cfg.stack-analysis: fix another corner case with ##peek insertion, and fix changed-loc merging
2009-06-28 22:52:28 -05:00
Doug Coleman
1fab8efeee
Merge branch 'master' of git://factorcode.org/git/factor
2009-06-28 16:43:45 -05:00
Doug Coleman
3b0954f63e
fix bug in linear-scan.resolve by rewriting entire algorithm
2009-06-28 16:43:17 -05:00
Slava Pestov
d4de1d38b9
Merge branch 'master' of git://factorcode.org/git/factor
2009-06-27 17:33:00 -05:00
Slava Pestov
d5179b724e
compiler.cfg.stack-analysis: Fix case where both an ##inc-d/r and a ##peek get inserted
2009-06-27 17:32:37 -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
ef32eb2e72
Fix bootstrap and unit test
2009-06-26 17:44:33 -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
22fa524db1
compiler.cfg.stack-analysis: split up into three vocabs
2009-06-24 13:54:43 -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
2dcdfa2d8e
compiler.cfg: add a declaration to fix tools.deploy.test.11
2009-06-09 03:36:16 -05:00
Slava Pestov
45a2105449
cpu.x86.assembler: IMUL2 instruction was busted for immediate operands
...
When given a register and an immediate, it would generate imul imm,dst,dst however the 64-bit prefix was generated wrong and if dst was an extended register only the first operand would be an extended register. To fix this, change IMUL2 to not work on immediates anymore, and added a new IMUL3 that takes a destination register, source register, and immediate. Also, change compiler.cfg.two-operand to not two-operandize %mul-imm, since this isn't needed anymore.
This fixes the sporadic benchmark.tuple-arrays crash on 64-bit machines.
2009-06-08 21:15:52 -05:00
Slava Pestov
70b75b8dea
Linear scan: implement live range intersection
2009-06-06 01:04:12 -05:00
Slava Pestov
7c207ffa12
compiler.cfg.optimizer: disable CFG checker by default
2009-06-05 18:07:22 -05:00
Slava Pestov
04c72d0a72
Linear scan: correctly compute live spill slots
2009-06-05 18:06:47 -05:00
Slava Pestov
5bb235d38f
compiler.cfg.checker: run if a variable is set
2009-06-05 17:32:12 -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
9da8cfe942
Merge branch 'master' of git://factorcode.org/git/factor
2009-06-02 18:30:25 -05:00
Slava Pestov
2d231f066a
GC checks now save and restore registers
2009-06-02 18:23:47 -05:00
Doug Coleman
19d6285035
fix load error
2009-06-01 09:34:28 -05:00
Slava Pestov
7dd08892b2
Fix for recent word renaming
2009-06-01 03:19:35 -05:00
Slava Pestov
9e987e8642
Merge branch 'master' into global_optimization
2009-06-01 03:12:32 -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
2c8223fdaf
Fix loop handling in stack-analysis
2009-05-31 19:04:26 -05:00
Slava Pestov
32f17f3e14
Fix scoping issue in compiler.cfg.linear-scan.assignment
2009-05-31 18:21:23 -05:00
Slava Pestov
1a52414bb1
Rename _gc to ##gc
2009-05-31 18:21:11 -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
3e00dc8c8d
Start cleaning up stack analysis
2009-05-30 13:22:30 -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
280736ab00
On second thought, linearization will be done after SSA destruction so live-in is accurate
2009-05-29 05:45:40 -05:00
Slava Pestov
743550f19c
Put GC checks in the right place when linearizing, and generate _dispatch-labels
2009-05-29 05:36:04 -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
ceb332f596
compiler.cfg.alias-analysis: ##peek needs to set alias class of output value
2009-05-28 18:19:01 -05:00
Slava Pestov
dbf18927b9
compiler.cfg.liveness: correct handling of phi nodes
2009-05-28 17:54:27 -05:00
Slava Pestov
fc5587bda3
Test updates
2009-05-28 02:50:07 -05:00
Slava Pestov
ecece1d08b
CFG checker now checks consistency of successors and predecessors lists; fix long-standing bug in useless-blocks optimization
2009-05-28 02:49:51 -05:00
Slava Pestov
1fa465d77f
Fix alias analysis
2009-05-28 02:48:58 -05:00
Slava Pestov
117cb78d6b
Fixing local optimizations
2009-05-27 18:58:41 -05:00
Slava Pestov
f3688c9373
Better CFG checker
2009-05-27 18:58:14 -05:00
Slava Pestov
dadb9a2c50
Add phi elimination pass
2009-05-27 18:58:01 -05:00
Slava Pestov
3b79d61496
Add a new ##allocation union to remove some code duplication
2009-05-27 18:55:49 -05:00
Slava Pestov
2025823ba6
Remove old local DCE pass
2009-05-27 17:55:15 -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
eda44f28a6
Move maybe-set-at to assocs
2009-05-26 18:45:37 -05:00
Slava Pestov
ccb662c60e
Fix another bug in stack-analysis
2009-05-26 03:42:39 -05:00
Slava Pestov
7ea4e255fb
compiler.cfg.stack-analysis: make it pass more tests
2009-05-26 02:59:14 -05:00
Slava Pestov
8b022f926c
compiler.cfg.dce: new global dead code elimination pass
2009-05-26 02:58:57 -05:00
Slava Pestov
e0841fa695
compiler.cfg.checker: new check-rpo word
2009-05-26 02:58:40 -05:00
Slava Pestov
a08bbde2e7
compiler.cfg.stack-analysis: progress
2009-05-25 19:18:13 -05:00
Slava Pestov
dead771b3f
compiler.cfg.checker: new vocabulary for checking CFG invariants
2009-05-25 19:16:58 -05:00
Slava Pestov
a2b982e247
compiler.cfg.builder: don't make basic blocks after terminating calls
2009-05-25 19:16:36 -05:00
Doug Coleman
407377fc98
rename peek -> last and update all usages
2009-05-25 16:38:33 -05:00
Slava Pestov
145f1dbeef
compiler.cfg.stack-analysis: change how inc-d/inc-r work
2009-05-23 15:47:08 -05:00
Slava Pestov
6af61656f3
CFG optimizer work in progress - adding phi nodes
2009-05-21 16:49:28 -05:00
Slava Pestov
e58fcd485c
Working on global optimizations
2009-05-19 17:28:13 -05:00
Slava Pestov
fb6df472a2
Cleaning up USING: lists for new strict semantics
2009-05-14 16:54:16 -05:00
Slava Pestov
fc4894fbdf
Replace ratio and complex built-in types with tuples defined in the library. This frees up two lo-tags, so move array and quotation over to these tags and update compiler for new tags
2009-04-30 00:27:35 -05:00
Slava Pestov
7f766ab355
Update compiler tests for tag number changes
2009-04-28 21:43:30 -05:00
Slava Pestov
057f75e9a1
Refactor compiler.tree.builder to fix various regressions
2009-04-21 23:02:00 -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
ea60f8ae93
Changing : foo ; parsing to SYNTAX: foo ;
2009-03-21 01:27:50 -05:00
Slava Pestov
ca7a155b72
Merge branch 'master' into new_ui
2009-03-01 20:13:05 -06:00
Slava Pestov
03cb32ad9c
Make execute( faster, add execute-unsafe( and make effect tuple slots read only
2009-03-01 20:12:35 -06:00
Slava Pestov
ce1bc1d6ed
Fixing conflicts from stack checker changes
2009-02-24 01:21:10 -06: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
634435d816
Merge branch 'master' into new_ui
2009-02-15 04:07:51 -06:00
Slava Pestov
cddb1f6133
Fix spelling
2009-02-15 04:07:05 -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
Doug Coleman
3c408342ef
renaming: contain? -> any?, deep-contains? -> deep-any?, pad-left -> pad-head, pad-right -> pad-tail, trim-left -> trim-head, trim-right -> trim-tail
2009-01-29 22:19:07 -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
65a53e1fa5
Don't keep compiled-effect around anymore
2009-02-23 23:55:16 -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
c5160d76e9
Merge qualified, alias, symbols, constants into core
2008-12-17 18:10:01 -06:00
Slava Pestov
0021cde743
Fix more compile errors
2008-12-15 22:21:56 -06:00
Slava Pestov
daf2857d7b
define-inline now takes an effect parameter
...
C: now sets the stack effect of the new word to slot names
add new basis/constants vocab; CONSTANT: foo bar is equivalent to : foo bar ; inline
(going to fold CONSTANT:, ALIAS: and qualified into core soon perhaps)
tighten the screws: inline words now need a stack declaration too
update some usages of inline words
2008-12-15 19:44:56 -06:00
Slava Pestov
eb79c6ab71
Fix conflict
2008-12-09 17:52:45 -06:00
Slava Pestov
4f0a9f311e
Untangling some dependencies
2008-12-08 14:58:00 -06:00
Slava Pestov
8a8f0c925c
Use BSR instruction to implement fixnum-log2 intrinsic
2008-12-06 15:31:17 -06:00
Slava Pestov
145b635eb6
More optimization intended to reduce compile time. Another 10% speedup on compiling empty PEG parser
...
- new map-flat combinator replaces usages of 'map flatten' in compiler
- compiler.tree.def-use.simplified uses an explicit accumulator instead of flatten
- compiler.tree.tuple-unboxing uses an explicit accumulator instead of flatten
- fix inlining regression from last time: custom inlining results would sometimes be discarded
- compiler.tree's 3each and 3map combinators rewritten to not use flip
- rewrite math.partial-dispatch without locals (purely stylistic, no performance increase)
- hand-optimize flip for common arrays-of-arrays case
- don't run escape analysis and tuple unboxing if there are no allocations in the IR
2008-12-06 11:17:19 -06:00
Slava Pestov
a56d480aa6
Various optimizations leading to a 10% speedup on compiling empty EBNF parser:
...
- open-code getenv primitive
- inline tuple predicates in finalization
- faster partial dispatch
- faster built-in type predicates
- faster tuple predicates
- faster lo-tag dispatch
- compile V{ } clone and H{ } clone more efficiently
- add fixnum fast-path to =; avoid indirect branch if two fixnums not eq
- faster >alist on hashtables
2008-12-06 09:16:29 -06:00
Slava Pestov
908644ee7a
O(1) <sbuf> and new-sequence on byte-arrays (work in progress)
2008-12-05 07:28:52 -06:00
Slava Pestov
e256846acd
Tweak string representation; high bit indicates if character has high bits in aux vector. Avoids memory access in common case. Split set-string-nth into two primitives; set-string-nth-fast is open-coded by optimizing compiler. 13% improvement on reverse-complement
2008-12-05 06:38:51 -06:00
Slava Pestov
e7f4563374
fixnum* intrinsic for x86
2008-11-30 07:26:49 -06:00
Slava Pestov
1c0789e616
Didn't generate ##branch after ##alien-invoke and ##alien-indirect
2008-11-29 03:46:57 -06:00
Slava Pestov
67471dedac
Forgot to emit a ##branch after ##fixnum-{add,sub,mul} ops; tools.annotations test faild
2008-11-29 00:36:43 -06:00
Slava Pestov
68dd6cc35a
Working on PowerPC overflow checks
2008-11-28 20:02:50 -06:00
Slava Pestov
eb8c621b6f
Faster generic arithmetic on fiixnums: both-fixnums? sub-primitive performs a check if the top two stack items are both fixnums with a single conditional branch
2008-11-28 08:35:02 -06:00
Slava Pestov
f44506089d
More work on overflow instructions: don't need temp register anymore, add -tail variants which don't need stack frame
2008-11-28 06:36:30 -06:00
Slava Pestov
5634becda1
##fixnum-add, ##fixnum-sub instructions open-code overflow check
2008-11-28 05:33:58 -06:00