]> gerrit.simantics Code Review - simantics/platform.git/commit
(refs #7042) Added a new compiler optimization (eta-reduce) 34/334/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 20 Feb 2017 09:17:31 +0000 (11:17 +0200)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 20 Feb 2017 09:17:31 +0000 (11:17 +0200)
commit51a4b7a930406a4890258f598661edc4b44e181a
tree7456b4177d846fd9e2e12d4378bfda26c9aab83a
parent1463e5c4bbbd37f7ff86abe25da59b3e39977cee
(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]