Commit Graph

292 Commits (b5fd809209ee54ddf5d635d37581dc473d1c20d1)

Author SHA1 Message Date
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 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
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 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 4fe0257169 cpu.x86: use SQRTSD instruction for math.libm:fsqrt word 2009-08-25 23:22:15 -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 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 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
Doug Coleman 7c3824639e move if-zero etc to math, remove 1-/1+ from math 2009-08-14 14:27:23 -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
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
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 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 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 00254d1bde compiler.cfg.ssa.destruction: new implementation: simpler and more correct 2009-08-02 10:26:52 -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 420e28b8bd compiler.tree.propagation.info: fix load error 2009-07-27 00:30:24 -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 df874c3b50 compiler.tree.finalization: undo a change that resulted in a compile time regression 2009-07-18 03:33:24 -05:00
Slava Pestov 9e6e61edfa 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 d053f88431 compiler.tree.propagation.transforms: fix shift transform 2009-07-17 00:02:57 -05:00
Slava Pestov 39a70db831 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
Slava Pestov 99faf3c79f 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
Daniel Ehrenberg 5a5a6a34b9 fixing stupid bug in propagation 2009-07-16 00:43:54 -05:00
Daniel Ehrenberg a295b28652 define-partial-eval framework in propagation pass makes it easy to add transforms; moving some transforms from stack checker to propagation, making them stronger 2009-07-16 00:34:50 -05:00
Daniel Ehrenberg ad301b07ae new is inlined in the propagation pass when the class is known 2009-07-14 14:16:39 -05:00
Daniel Ehrenberg c6c5be4eb0 call( and execute( inline known quotations/words in the propagation pass 2009-07-14 01:12:45 -05:00
Daniel Ehrenberg 55e5d60b23 Adding authors to compiler.tree.modular-arithmetic 2009-07-09 23:09:49 -05:00
Daniel Ehrenberg bf706063e2 Improving modular arithmetic optimization to be aware of words like set-alien-unsigned-2 2009-07-09 23:07:38 -05:00
Slava Pestov 511ca9dea0 compiler.tree.propagation: better length propagation 2009-07-09 02:28:30 -05:00
Slava Pestov e21cf72927 compiler.tree.dead-code: methods on flushable generics should be flushable 2009-07-03 21:31:26 -05:00
Slava Pestov 2b5df8c298 compiler.tree.optimizer: Remove redundant call to compute-def-use 2009-07-01 17:41:20 -05:00
Slava Pestov 9eec019e9b Remove initial-quot feature 2009-06-15 13:07:15 -05:00
Slava Pestov 48c31d441c Add some failing unit tests exposing bugs in initial-quot: implementation 2009-06-13 18:34:27 -05:00
Doug Coleman 34dcd28362 add an iota 2009-06-10 09:45:48 -05:00
Slava Pestov 3de85158de Merge branch 'master' into global_optimization 2009-06-01 03:12:32 -05:00
Slava Pestov 1fc830a99e Add a with-scope so that optimize-tree doesn't pollute namespace 2009-05-27 18:58:54 -05:00
Doug Coleman 8da9d0f203 rename peek -> last and update all usages 2009-05-25 16:38:33 -05:00
Doug Coleman 34e1d60578 add a clamp word to math.order, use clamp word throughout libraries 2009-05-24 21:35:50 -05:00
Slava Pestov c2499cdd55 stack-checker: fix case where invalid code could infer 2009-05-23 15:50:35 -05:00
Joe Groff 483c936eb3 get rid of useless test 2009-05-21 20:56:57 -05:00
Slava Pestov ba04d5af1e Update documentation for stricter vocabulary search path semantics 2009-05-16 00:29:21 -05:00
Slava Pestov 344f3668e4 Fix escape analysis bug reported by Doug 2009-05-15 17:18:38 -05:00
Slava Pestov d7db5edadc Cleaning up USING: lists for new strict semantics 2009-05-14 16:54:16 -05:00
Slava Pestov 302d829ea9 Fix compiler breakage if a GENERIC# has an incorrect stack effect declaration 2009-05-12 21:23:52 -05:00
Slava Pestov 70deacb900 Fix unit tests and load errors for slip removal 2009-05-10 17:03:41 -05:00
Slava Pestov e55f0d17e5 compiler.tree.modular-arithmetic: convert >integer >fixnum into >fixnum 2009-05-07 12:54:23 -05:00
Slava Pestov 3c19ec1cbb Fix overly-eager strength reduction for mod, and add a type function for >integer (reported by Joe Groff) 2009-05-07 12:32:06 -05:00
Slava Pestov 1e2561f863 Make walker work better with call( and breakpoints which are nested inside combinators 2009-05-05 09:12:32 -05:00
Slava Pestov 2c78b77f36 Fix infinite loop when compiling a word containing a tuple literal with circular structure in it. This was triggered by call( inline caching in core-foundation.fsevents on Mac OS X 2009-05-01 09:36:53 -05:00
Slava Pestov e5cdb7ac2d call( fast-path now supports curry and compose 2009-04-30 21:08:29 -05:00
Slava Pestov 964fbd0a24 Fix test failures from ratio/complex built-in removal 2009-04-30 00:38:55 -05:00
Slava Pestov 663db67b23 compiler.tree.debugger: wasn't counting intrinsics properly when computing report 2009-04-30 00:27:51 -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 bba30dc284 Fix conflict from master 2009-04-27 17:09:09 -05:00
Slava Pestov dac5203e81 compiler.tree.builder: Fix scoping of a variable by hints vocab 2009-04-26 16:04:44 -05:00
Slava Pestov 3dc9fdf9db Fleshed out new dispatch code 2009-04-24 20:43:01 -05:00
Slava Pestov 5649cc7a0a Compiler warnings are no more 2009-04-23 22:17:25 -05:00
Slava Pestov 1dd3ed519f Revert part of an earlier ccompiler.tree.checker hange to fix smalltalk.eval regression 2009-04-22 21:03:53 -05:00
Doug Coleman 7f983f12d4 fix help lint failures, fix example in words 2009-04-22 12:26:28 -05:00
Slava Pestov dea3987ca5 Silly workaround for performance regression 2009-04-22 00:44:06 -05:00
Slava Pestov 057f75e9a1 Refactor compiler.tree.builder to fix various regressions 2009-04-21 23:02:00 -05:00
Slava Pestov 469c9ee21d Debugging stack checking 2009-04-21 16:09:53 -05:00
Slava Pestov f38d2f91f6 Words which didn't compile cannot be run at all 2009-04-20 22:05:41 -05:00
Slava Pestov 05f3f9dcb9 Fixing unit tests for stack effect inference changes 2009-04-20 21:15:19 -05:00
Slava Pestov 8414693142 stack-checker: trust word declarations instead of recursively checking them 2009-04-20 18:44:45 -05:00
Slava Pestov 5165d811d5 Changing the stack effect of a generic word could break the compiler 2009-04-20 04:21:00 -05:00
Slava Pestov ec49307c88 Never inline default methods, and fix inlining of methods with hints 2009-04-20 03:27:18 -05:00
Doug Coleman 332bde4173 use iota in a few places 2009-04-17 16:17:11 -05:00
Slava Pestov ce76331fd6 Fixing more unit tests 2009-04-17 15:50:03 -05:00
Doug Coleman dba4c0d589 fixing compiler errors in basis 2009-04-17 12:46:04 -05:00
Slava Pestov 0a5b076c11 Make the walker infer 2009-04-16 23:14:11 -05:00
Slava Pestov 65b27354ad Merge branch 'master' into smarter_error_list 2009-04-14 15:07:22 -05:00
sheeple a4e62dfdba Fix for math.parser syntax change 2009-04-13 14:47:39 -05:00
Slava Pestov deae1d7bbb Fix bootstrap 2009-04-10 04:41:26 -05:00
Slava Pestov 37e278ed02 Use [ ] [ ] map-reduce instead of unclip [ ] reduce 2009-04-06 17:50:54 -05:00
Slava Pestov 268abfcf2a Remove method-specs in favor of M\ 2009-04-06 02:59:59 -05:00
Slava Pestov 932d44cab8 Small speedup for code using H{ } clone and with-scope 2009-03-31 08:16:04 -05:00
Slava Pestov ff07c8f352 Fix compiler.tree.debugger tests 2009-03-25 22:53:03 -05:00
Slava Pestov 9b8dd01c0b Fix bitrot in compiler.tree.debugger 2009-03-25 10:11:58 -05:00
Slava Pestov 6080c6e734 Fix stack effect redefinition 2009-03-22 20:16:31 -05:00
Slava Pestov 2f4e2735ea Fix compile errors in compiler tests so that they actually test the compiler instead of being useless 2009-03-22 17:50:53 -05:00