LSL-PyOptimizer/lslopt
Sei Lisa 0808938894 Optimizations based on addition algebra for floats and integers
Float addition is commutative. Swap the constant to the left side if it's not there. This is a "cheap" version of a bigger change that is planned, to minimize stack usage as much as possible on savepoints.

Float addition is not associative, therefore we don't optimize e.g. 1 + (2 + float).

Integer addition is commutative and associative. If there's a constant, we swap it to the left side. If there's a chained summation of the form const + (const + expression), we apply associativity to turn it into (const + const) + expression and reoptimize.

This doesn't cover all possible cases. Expressions of the form (const + expr) + (const + expr) are not optimized. We need to flatten sums if we want to do the right thing here, but that's not yet implemented.

Get rid of some older code and TODOs that are no longer needed.
2018-06-07 23:57:21 +02:00
..
__init__.py Initial commit. Status so far: 2014-07-26 02:43:44 +02:00
lslbasefuncs.py Refine the denormal check for Mono 2018-05-09 19:04:09 +02:00
lslcommon.py Remove commented-out print_node function (superseded by nr.__str__) 2018-06-07 02:14:15 +02:00
lsldeadcode.py Get rid of DoesSomething() in favour of SEF 2018-05-17 09:08:48 +02:00
lslextrafuncs.py Bump copyright year 2018-03-23 16:36:45 +01:00
lslfoldconst.py Optimizations based on addition algebra for floats and integers 2018-06-07 23:57:21 +02:00
lslfuncopt.py Change the AST node type from dict to object 2018-04-01 02:14:00 +02:00
lslfuncs.py Bump copyright year 2018-03-23 16:36:45 +01:00
lsljson.py Bump copyright year 2018-03-23 16:36:45 +01:00
lsllastpass.py Change the AST node type from dict to object 2018-04-01 02:14:00 +02:00
lslloadlib.py Bump copyright year 2018-03-23 16:36:45 +01:00
lsloptimizer.py Change the AST node type from dict to object 2018-04-01 02:14:00 +02:00
lsloutput.py Change the AST node type from dict to object 2018-04-01 02:14:00 +02:00
lslparse.py Fix bug with key variable in list within globals 2018-05-17 19:05:00 +02:00
lslrenamer.py Change the AST node type from dict to object 2018-04-01 02:14:00 +02:00