Commit Graph

1096 Commits (ebcaaa0d64505086d6399ccce04391853ff7ffff)

Author SHA1 Message Date
Daniel Ehrenberg 2019c0a747 Merge branch 'master' of git://factorcode.org/git/factor into constraints 2009-09-22 16:09:33 -05:00
Daniel Ehrenberg 198fdc82ab Fixing failing unit tests in compiler.tree.propagation due to constraints 2009-09-22 16:01:14 -05:00
Doug Coleman 28e5a27c3f Merge branch 'master' of git://factorcode.org/git/factor
Conflicts:
	core/generic/generic-tests.factor
2009-09-22 10:25:42 -05:00
Slava Pestov 9a7577a58b 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 8c2f5543cc Merge branch 'master' into integer-simd 2009-09-22 03:24:52 -05:00
Slava Pestov 0778c20722 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
Doug Coleman e8502d1ebc Merge branch 'master' of git://factorcode.org/git/factor 2009-09-21 17:59:48 -05:00
Slava Pestov e6cddf1fa7 Merge branch 'master' of git://factorcode.org/git/factor into integer-simd 2009-09-21 17:58:24 -05:00
Slava Pestov 85c916fedc Rename specific-method to method-for-class, rename (effective-method) to method-for-object, and make both much faster 2009-09-21 17:42:20 -05:00
Slava Pestov e04fba6bc7 Fix conflict 2009-09-20 23:18:07 -05:00
Slava Pestov 66871995c9 math.vectors.simd: add saturated arithmetic operations 2009-09-20 23:16:02 -05:00
Doug Coleman 026761ed62 Merge branch 'master' of git://factorcode.org/git/factor
Conflicts:
	basis/classes/struct/struct-tests.factor
	basis/functors/functors-tests.factor
	basis/specialized-arrays/specialized-arrays-tests.factor
2009-09-20 23:02:49 -05:00
Doug Coleman 47fab85a00 replace usages of <" with """ 2009-09-20 22:42:40 -05:00
Slava Pestov 78c949b9b7 math.vectors: add v+- word which is accelerated by SSE3 2009-09-20 17:43:16 -05:00
Slava Pestov dfb43bd2ca More integer SIMD work
- move generated vocab support from specialized-arrays to vocabs.generated
- add fuzz testing to math.vectors.simd
- add alien type support for integer SIMD vectors
- SIMD: parsing word generates a SIMD type, instead of pre-generating them all in math.vectors.simd
2009-09-20 16:48:17 -05:00
Slava Pestov fc5fe2bd2a Merge Phil Dawes' VM work 2009-09-20 03:48:08 -05:00
Joe Groff 4a1422e7fe move some allocation words that don't really have much to do with c types out of alien.c-types into a new alien.data vocab 2009-09-17 22:36:05 -05:00
Joe Groff ac5ea1769b get compiler tests loading 2009-09-16 09:20:47 -05:00
Phil Dawes f5e6d43e1e separated vm-1st-arg and vm-3rd-arg asm invoke words (needed for ppc & x86.64) 2009-09-16 08:20:09 +01:00
Phil Dawes 6e5ddc0c33 vm pointer passed to nest_stacks and unnest_stacks (win32) 2009-09-16 08:17:26 +01:00
Phil Dawes 2a1a4ccf27 fixed up getenv compiler intrinsic to use vm struct userenv 2009-09-16 08:16:32 +01:00
Phil Dawes b70e60eaea added VM relocation type 2009-09-16 08:16:30 +01:00
Joe Groff 334e93bbbf get things to a point where they bootstrap again 2009-09-15 21:43:18 -05:00
Joe Groff 02b797f11b 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 aeb6a01710 compiler.tree.propagation: fix unary-op type functions with complex number inputs 2009-09-15 14:30:20 -07:00
Slava Pestov 1b5614f974 math.functions: more accurate log10 (fixes problem reported by OneEyed) 2009-09-14 16:19:58 -05:00
Slava Pestov 8c46388272 compiler.cfg.builder: don't run certain tests if float intrinsics are not available 2009-09-13 23:12:47 -05:00
Slava Pestov 427bfb4ab8 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 7aac0d69d6 ALIEN: now reads a hexadecimal integer instead of a decimal one, since in general hex is more useful for addresses 2009-09-12 21:17:53 -05:00
Slava Pestov 10423e0d56 compiler.tree.propagation: convert /i of a positive integer by a power of two into a shift 2009-09-11 21:03:11 -05:00
Slava Pestov 89d6096130 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 527db8995a Specialized array overhaul
- Replace hand-written specialized-arrays.* subvocabularies with new system; instead of USE:ing specialized-arrays.T, do SPECIALIZED-ARRAY: T
- Ditto for specialized-vectors; use SPECIALIZED-VECTOR:
- io.mmap.functor: removed entirely, use <mapped-array> instead
- struct-arrays and struct-vectors have been removed because specialized arrays and vectors subsume them entirely
2009-09-09 22:33:34 -05:00
Slava Pestov 66f500bdd7 Fix the build 2009-09-09 13:44:54 -05:00
Slava Pestov 72eec2c53e compiler.cfg.save-contexts: add new pass 2009-09-08 21:56:28 -05:00
Slava Pestov 092b31910d 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 025a5b7b15 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 88b4780096 Merge branch 'master' of git://factorcode.org/git/factor 2009-09-08 14:22:52 -05:00
Slava Pestov 8eeeeb5c5b inline alien-vector and set-alien-vector if SIMD is not available for a small speedup 2009-09-08 13:56:17 -05:00
Doug Coleman 551c06db2d Merge branch 'master' of git://factorcode.org/git/factor 2009-09-08 13:22:52 -05:00
Slava Pestov 17821626c3 Fix conflicts 2009-09-07 23:51:25 -05:00
Slava Pestov b279c5751c compiler.tree.propagation: type check inputs to unsafe foldable words manually, so that stuff like [ "Hi" { } fixnum+fast ] doesn't crash in the compiler 2009-09-07 23:40:23 -05:00
Slava Pestov 0b35d79aee compiler.tree.propagation.call-effect: stronger call( inlining; now can inline 'a [ b ] curry call(' where 'a' is literal, [ b ] doesn't infer, but [ a b ] does infer. This simplifies classes.struct:memory>struct 2009-09-07 17:45:03 -05:00
Slava Pestov e20e9008ea compiler.cfg.value-numbering: update tests for Joe's condition code changes 2009-09-04 03:11:56 -05:00
Slava Pestov 555543faae compiler: tweak generated code 2009-09-04 03:01:18 -05:00
Slava Pestov 1c87486320 math.vectors.simd: allow punning SIMD vectors between types 2009-09-04 02:35:58 -05:00
Slava Pestov 8223715a07 compiler.cfg.intrinsics: fix type detection on the alien type for vector accessors 2009-09-04 02:22:54 -05:00
Slava Pestov 1f5193198b compiler: clean up code generation for alien boxing/unboxing a bit 2009-09-03 21:22:43 -05:00
Slava Pestov 20dfbf7ac8 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 0b9e5c034a 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 9cc705f6ba 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 11aadb74af compiler.tree.propagation: type function for clone had an issue, sometimes clone would get optimized out because of incorrect constant folding 2009-09-03 02:40:18 -05:00
Slava Pestov 52b99c050e 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 775b9af2f7 compiler: eliminate boilerplate by centralizing info in declarative INSN: syntax 2009-09-02 06:22:37 -05:00
Slava Pestov 14a063dd92 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 0cf3151216 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 74d196d77c compiler/tests/codegen.factor: don't do exact float comparison 2009-08-30 18:57:45 -05:00
Slava Pestov 43af9b06a4 compiler.cfg.linear-scan.live-intervals: dead-value-error is never thrown anymore 2009-08-30 05:15:18 -05:00
Slava Pestov b35a01879e %box-displaced-alien: fix clobberage found by Doug 2009-08-30 05:11:08 -05:00
Slava Pestov f6a836d1e9 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 fa64522421 compiler.cfg.value-numbering: fix ##box-displaced-alien simplification 2009-08-28 19:05:49 -05:00
Slava Pestov f30aa5d20e compiler: add fixnum-min/max intrinsics; ~10% speedup on benchmark.yuv-to-rgb 2009-08-28 19:02:59 -05:00
Slava Pestov 99bf9fadfb 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 5f33f7306f compiler.tree.propagation.transforms: don't fail to compile if 'at' called on something that's not an assoc 2009-08-27 18:57:56 -05:00
Slava Pestov c9cba1cc00 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 9caf3f9248 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
Doug Coleman 546367b88a use structs 2009-08-26 11:01:39 -05:00
Doug Coleman be57edbff2 Merge branch 'master' of git://factorcode.org/git/factor 2009-08-26 09:15:33 -05:00
Slava Pestov 40b522c9d0 compiler.cfg.linear-scan: fix unit tests for new fake-representations 2009-08-26 08:58:00 -05:00
Slava Pestov 02ec791ab7 compiler: only run float test in low-level-ir if float intrinsics enabled; fixes SIGILL on non-sse2 x86 machines 2009-08-26 06:58:47 -05:00
Slava Pestov d5fb53d417 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 4fe0257169 cpu.x86: use SQRTSD instruction for math.libm:fsqrt word 2009-08-25 23:22:15 -05:00
sheeple 2f789f735d basis/compiler/tests/low-level-ir: add ##copy double-float-rep test 2009-08-25 19:41:17 -05:00
Doug Coleman 96120dc8e5 update new structs again 2009-08-25 16:31:58 -05:00
Doug Coleman 3fa6500cd2 update compiler.tests.alien to joe's latest changes 2009-08-25 12:00:06 -05:00
Doug Coleman 3d05dd1abf use new structs wherever possible in compiler tests 2009-08-25 11:59:33 -04:00
Slava Pestov 009d3a87f6 Add some unit tests 2009-08-22 17:15:10 -05:00
Slava Pestov 930c9ed2ac next-fastcall-param word was not being called; on x86 its equivalent to inc but on ppc there is more logic, this fixes FFI on PowerPC 2009-08-21 20:15:19 -05:00
Slava Pestov c15555056e 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 0bfbcd2108 compiler.tree.modular-arithmetic: fix regression; set-alien-*-1 was not always open-coded 2009-08-20 17:56:49 -05:00
Slava Pestov 78f8d02ed4 compiler.tree.modular-arithmetic: eliminate >bignum calls where possible, convert fixnum-shift to fixnum-shift-fast if shift count is positive, don't run if there are no modular values 2009-08-20 03:47:45 -05:00
Slava Pestov b57894a78c compiler.tree.propagation: bitand custom inlining was wrong if the second input was a bignum 2009-08-20 03:47:07 -05:00
Slava Pestov 54ee3c3d01 compiler.cfg.stacks.local: more accurate local replace set computation; optimizes out 'swap swap' 2009-08-19 22:00:21 -05:00
Slava Pestov 552d069e9f compiler: add unit tests for new bugs 2009-08-19 16:56:26 -05:00
Slava Pestov c9cc1fa6a9 Fix interval inference of abs, absq when input is a complex number 2009-08-19 16:06:37 -05:00
Slava Pestov 75137bafb1 compiler.tree.propagation: improved interval inference for absq eliminates a conditional from math.vectors:distance. Type inference for rational math also a bit sharper now 2009-08-19 02:33:41 -05:00
Slava Pestov 771488d87b Fix some unit test failures 2009-08-18 03:49:05 -05:00
Slava Pestov 79a3f6b0d5 compiler: inline singleton predicates, and optimize predicate engines, reduces terrain demo deployed size by ~20kb 2009-08-17 23:59:24 -05:00
Slava Pestov b3693e3c3b compiler.tree.propagation: remove method inlining heuristic 2009-08-17 22:29:05 -05:00
Slava Pestov a742145fd9 compiler.tree.modular-arithmetic: >fixnum elimination and value info annotations were too aggressive 2009-08-17 01:20:25 -05:00
Slava Pestov aeb33f5f15 compiler.tree.modular-arithmetic: stronger optimization handles > 1 usages case as well as values defined and used in loops. Eliminates 5 out of 8 >fixnum calls in benchmark.yuv-to-rgb 2009-08-15 18:42:41 -05:00
Daniel Ehrenberg d93f6ed1f3 Merge branch 'master' of git://factorcode.org/git/factor 2009-08-14 20:11:54 -05:00
Daniel Ehrenberg 595e3b96cd Improving write barrier elimination; change to compiler.cfg.utilities to support this 2009-08-14 19:41:41 -05:00
Doug Coleman 7c3824639e move if-zero etc to math, remove 1-/1+ from math 2009-08-14 14:27:23 -05:00
Daniel Ehrenberg 54389b5e5c Write barriers are hoisted out of loops when their target is slot-available 2009-08-13 20:26:44 -05:00
Doug Coleman 9f1030030d Merge branch 'master' of git://factorcode.org/git/factor
Conflicts:
	basis/calendar/calendar.factor
2009-08-13 19:40:02 -05:00
Doug Coleman d1ce837569 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 25fad6550f Global write barrier elimination tracks newly allocated objects 2009-08-13 15:18:47 -05:00
Daniel Ehrenberg 3aa4682301 Merge branch 'master' of git://factorcode.org/git/factor 2009-08-12 23:56:05 -05:00
Daniel Ehrenberg f80416b40e Fixing write-barrier elimination; adding bb as a parameter to join-sets in dataflow analysis 2009-08-12 23:52:29 -05:00
Slava Pestov 6f2170eb02 More accurate wrap-interval in compiler.tree.propagation.info fixes test regression; constructing an interval with endpoints at infinity now outputs full-interval 2009-08-12 03:25:53 -05:00
Daniel Ehrenberg 82d20d292c Making write barrier elimination global 2009-08-11 21:21:21 -05:00
Slava Pestov 88f28a7245 math.intervals: fix interval-rem 2009-08-11 16:49:28 -05:00
Slava Pestov 5f0390d83b alien.complex: fix tests 2009-08-11 14:07:33 -05:00
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
Slava Pestov cf23ee7996 compiler.cfg.two-operand: make it work in more cases 2009-07-27 22:28:29 -05:00
Slava Pestov 064248d25b compiler.cfg.debugger: reset vreg counters 2009-07-27 22:28:13 -05:00
Slava Pestov 85975568d9 Debugging compiler.cfg.coalescing 2009-07-27 19:24:13 -05:00
Slava Pestov 3490456e07 compiler.cfg.parallel-copy: fix algorithm 2009-07-27 16:54:47 -05:00
Slava Pestov cef47c452a compiler.codegen: collect instruction statistics 2009-07-27 03:58:15 -05:00
Slava Pestov 7dec8d289e compiler.cfg.coalescing: fix shuffling bug 2009-07-27 03:58:01 -05:00
Slava Pestov e6d05dc722 compiler.cfg.phi-elimination: no longer needed 2009-07-27 02:20:53 -05:00
Slava Pestov 83d40198a4 compiler.cfg.coalescing: more or less complete, now needs debugging 2009-07-27 02:20:45 -05:00
Slava Pestov d7f12feb64 compiler.cfg.coalescing: more work done 2009-07-27 00:31:21 -05:00
Slava Pestov 420e28b8bd compiler.tree.propagation.info: fix load error 2009-07-27 00:30:24 -05:00
Slava Pestov 76de5a9376 compiler.cfg.coalescing: work in progress 2009-07-26 21:11:26 -05:00
Slava Pestov 0a3a08e506 compiler.cfg.copy-prop: remove ##phi nodes where all inputs are copy-equivalent 2009-07-26 21:11:02 -05:00
Slava Pestov 99601d34fa compiler.cfg.utilities: move value-info utilities to compiler.tree.propagation.info 2009-07-26 21:10:33 -05:00
Slava Pestov 5e39e8c11f compiler.cfg.def-use: build def-use chains 2009-07-26 21:10:14 -05:00
Slava Pestov 6f37596113 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 3293a72580 compiler.cfg.copy-prop: work in progress 2009-07-24 19:56:21 -05:00
Slava Pestov ce7236437f compiler.cfg.parallel-copy: forgot to add this 2009-07-24 19:46:33 -05:00
Slava Pestov 228fcea905 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 d8836f8927 compiler.cfg: Fixing test failures 2009-07-24 06:08:07 -05:00
Slava Pestov 127de28195 compiler.cfg.copy-prop: Global copy propagation 2009-07-24 05:30:46 -05:00
Slava Pestov c49d2cc7bc 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 fcd015970e 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 f1eddf34c9 compiler.cfg: introduce less temporaries when building CFG 2009-07-24 03:37:18 -05:00
Slava Pestov 229d1c9f47 compiler.cfg.builder: fix stack effect declaration 2009-07-23 21:24:15 -05:00
Slava Pestov c2c3d64d6d compiler.cfg.stacks: now performs online local DCN 2009-07-23 20:54:38 -05:00
Slava Pestov 377233bd90 Add testcase for recent bug 2009-07-23 18:03:14 -05:00
Slava Pestov 2726ebe4a9 compiler.cfg.linear-scan.mapping: simplify 2009-07-23 18:03:04 -05:00
Slava Pestov 2ec433e7c0 compiler.cfg.empty-blocks: new pass to delete empty blocks, runs after phi elimination 2009-07-23 18:02:46 -05:00
Slava Pestov 67c53c85b1 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 9d2a2ecabf compiler.cfg.intrinsics: Disable inline allocation for now 2009-07-22 21:11:06 -05:00
Slava Pestov 1651deaaa7 Fixing compiler tests 2009-07-22 21:10:50 -05:00
Slava Pestov 0632c9665c compiler.cfg.dcn.rewrite: remove unused word 2009-07-22 19:18:12 -05:00
Slava Pestov daf446f842 compiler.cfg.checker: eliminate dead code before checking MR 2009-07-22 19:17:57 -05:00
Slava Pestov dcf7ce82a9 compiler.cfg.builder: Fix construction of ##return instructions from #return-recursive nodes 2009-07-22 19:17:21 -05:00
Slava Pestov 50b4179647 Merge branch 'master' into dcn 2009-07-22 06:19:44 -05:00
Slava Pestov 093a685d68 compiler.cfg.dominance: fix unit tests 2009-07-22 06:19:31 -05:00
Slava Pestov 79d32afe4b compiler.cfg.ssa: now builds pruned SSA form 2009-07-22 06:08:04 -05:00
Slava Pestov 898ac710fa compiler.cfg.dominance: add algorithm for computing iterated dominance frontiers 2009-07-22 06:07:51 -05:00
Slava Pestov c355c21de6 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 a857ff3797 Removed unused code from compiler.cfg.def-use 2009-07-22 06:05:33 -05:00
Slava Pestov 7c488f2b25 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 0b78d8fd3d Fix bootstrap 2009-07-22 03:26:27 -05:00
Slava Pestov b6bb12eea7 compiler.cfg: Fix conflicts after merging local optimization refactoring into DCN branch 2009-07-22 03:17:53 -05:00
Slava Pestov 5d9f7b0ed2 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 670d694ab9 Merge branch 'master' into dcn 2009-07-22 02:07:08 -05:00
Slava Pestov 538a82b3bd Merge branch 'master' of git://factorcode.org/git/factor 2009-07-22 02:06:47 -05:00
Slava Pestov 89a048c0ac compiler.cfg.dataflow-analysis: iterative dataflow analysis framework 2009-07-22 02:06:35 -05:00