summaryrefslogtreecommitdiff
path: root/compiler/simplCore/SimplCore.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/simplCore/SimplCore.hs')
-rw-r--r--compiler/simplCore/SimplCore.hs16
1 files changed, 15 insertions, 1 deletions
diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs
index 70d5e0f250..6ebc92e699 100644
--- a/compiler/simplCore/SimplCore.hs
+++ b/compiler/simplCore/SimplCore.hs
@@ -43,6 +43,7 @@ import Specialise ( specProgram)
import SpecConstr ( specConstrProgram)
import DmdAnal ( dmdAnalProgram )
import CallArity ( callArityAnalProgram )
+import AnfiseCore ( anfiseProgram )
import Exitify ( exitifyProgram )
import WorkWrap ( wwTopBinds )
import Vectorise ( vectorise )
@@ -186,7 +187,7 @@ getCoreToDo dflags
-- inlined. I found that spectral/hartel/genfft lost some useful
-- strictness in the function sumcode' if augment is not inlined
-- before strictness analysis runs
- simpl_phases = CoreDoPasses [ simpl_phase phase ["main"] max_iter
+ simpl_phases = CoreDoPasses [ CoreDoPasses [ anfise, simpl_phase phase ["main"] max_iter ]
| phase <- [phases, phases-1 .. 1] ]
@@ -212,6 +213,16 @@ getCoreToDo dflags
[simpl_phase 0 ["post-worker-wrapper"] max_iter]
))
+ anfise = CoreDoPasses
+ [ CoreDoAnfise
+ , CoreDoFloatOutwards FloatOutSwitches { floatOutLambdas = Just 0
+ , floatOutConstants = True
+ , floatOutOverSatApps = True
+ , floatToTopLevelOnly = False
+ }
+ , CoreCSE
+ ]
+
-- Static forms are moved to the top level with the FloatOut pass.
-- See Note [Grand plan for static forms] in StaticPtrTable.
static_ptrs_float_outwards =
@@ -482,6 +493,9 @@ doCorePass CoreDoStaticArgs = {-# SCC "StaticArgs" #-}
doCorePass CoreDoCallArity = {-# SCC "CallArity" #-}
doPassD callArityAnalProgram
+doCorePass CoreDoAnfise = {-# SCC "ANFise" #-}
+ doPass anfiseProgram
+
doCorePass CoreDoExitify = {-# SCC "Exitify" #-}
doPass exitifyProgram