-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
53 additions
and
21 deletions.
There are no files selected for viewing
Submodule juvix-stdlib
updated
4 files
+4 −2 | Stdlib/Data/List.juvix | |
+1 −0 | Stdlib/Data/Map.juvix | |
+1 −1 | Stdlib/Trait/Foldable/Monomorphic.juvix | |
+1 −1 | Stdlib/Trait/Functor/Monomorphic.juvix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 19 additions & 2 deletions
21
src/Juvix/Compiler/Core/Transformation/Optimize/Phase/PreLifting.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
module Juvix.Compiler.Core.Transformation.Optimize.Phase.PreLifting where | ||
|
||
import Juvix.Compiler.Core.Data.IdentDependencyInfo | ||
import Juvix.Compiler.Core.Options | ||
import Juvix.Compiler.Core.Transformation.Base | ||
import Juvix.Compiler.Core.Transformation.Optimize.CaseFolding | ||
import Juvix.Compiler.Core.Transformation.Optimize.Inlining | ||
import Juvix.Compiler.Core.Transformation.Optimize.LambdaFolding | ||
import Juvix.Compiler.Core.Transformation.Optimize.LetFolding | ||
import Juvix.Compiler.Core.Transformation.Optimize.LoopHoisting | ||
|
||
optimize :: (Member (Reader CoreOptions) r) => Module -> Sem r Module | ||
optimize = | ||
withOptimizationLevel 1 $ | ||
optimize md = do | ||
CoreOptions {..} <- ask | ||
withOptimizationLevel' md 1 $ | ||
return | ||
. loopHoisting | ||
. letFolding | ||
. lambdaFolding | ||
. letFolding | ||
. caseFolding | ||
. compose | ||
2 | ||
( compose 2 (letFolding' (isInlineableLambda _optInliningDepth)) | ||
. lambdaFolding | ||
. inlining' _optInliningDepth nonRecSyms | ||
) | ||
. letFolding | ||
where | ||
nonRecSyms = nonRecursiveIdents md |