]> gerrit.simantics Code Review - simantics/platform.git/commit
(refs #7042) Added a new compiler optimization (eta-reduce)
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 20 Feb 2017 09:17:31 +0000 (11:17 +0200)
committerjsimomaa <jani.simomaa@gmail.com>
Fri, 28 Apr 2017 13:09:29 +0000 (16:09 +0300)
commit1f0740df5866486c2292e9f0ec583fadd42329a3
tree47d85b7a7c2c9942c07ba5ec7568dc1cee540da6
parent6a4cfb2185e2f0d006d3dd76615e7214da65c220
(refs #7042) Added a new compiler optimization (eta-reduce)

Adds new optimization to SCL compiler that transforms the following code
    \someParameters = f someOtherParameters someParameters'
to
    f someOtherParameters
with the following restrictions:
* someParameters and someParameters' are lists of equal variables
  or the type is ()
* someOtherParameters does not refer to variables in someParameters
  or the lambda expression itself or something depending on it
  recursively

[PRIVATE-13082]

Change-Id: I0e666771c72128ab73b0e46af727236ba4811080
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/SSAFunction.java
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/exits/Switch.java
tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ActiveTests.java
tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java
tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/ClosureRecursion.scl [new file with mode: 0644]
tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/SwitchSimplification.scl [new file with mode: 0644]