[commit: ghc] wip/T14152: New flag to simpl_phase to signal final phase (9dd6e49)

git at git.haskell.org git at git.haskell.org
Wed Sep 20 20:25:26 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T14152
Link       : http://ghc.haskell.org/trac/ghc/changeset/9dd6e490d4a5a0d98a1a6278e7ab309244763824/ghc

>---------------------------------------------------------------

commit 9dd6e490d4a5a0d98a1a6278e7ab309244763824
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Wed Sep 20 16:24:56 2017 -0400

    New flag to simpl_phase to signal final phase
    
    (This will be squashed before merging)


>---------------------------------------------------------------

9dd6e490d4a5a0d98a1a6278e7ab309244763824
 compiler/simplCore/SimplCore.hs | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs
index 91279c9..6c8a0d3 100644
--- a/compiler/simplCore/SimplCore.hs
+++ b/compiler/simplCore/SimplCore.hs
@@ -153,13 +153,13 @@ getCoreToDo dflags
                           , sm_case_case           = True
                           , sm_preserve_exit_joins = True}
 
-    simpl_phase phase names iter
+    simpl_phase phase names iter is_final
       = CoreDoPasses
       $   [ maybe_strictness_before phase
           , CoreDoSimplify iter
                 (base_mode { sm_phase = Phase phase
                            , sm_names = names
-                           , sm_preserve_exit_joins = names /= ["final"]
+                           , sm_preserve_exit_joins = is_final
                            })
 
           , maybe_rule_check (Phase phase) ]
@@ -188,7 +188,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 [ simpl_phase phase ["main"] max_iter False
                                 | phase <- [phases, phases-1 .. 1] ]
 
 
@@ -211,7 +211,7 @@ getCoreToDo dflags
     -- New demand analyser
     demand_analyser = (CoreDoPasses (
                            strictness_pass ++
-                           [simpl_phase 0 ["post-worker-wrapper"] max_iter]
+                           [simpl_phase 0 ["post-worker-wrapper"] max_iter False]
                            ))
 
     -- Static forms are moved to the top level with the FloatOut pass.
@@ -300,7 +300,7 @@ getCoreToDo dflags
                 -- ==>  let k = BIG in letrec go = \xs -> ...(k x).... in go xs
                 -- ==>  let k = BIG in letrec go = \xs -> ...(BIG x).... in go xs
                 -- Don't stop now!
-        simpl_phase 0 ["main"] (max max_iter 3),
+        simpl_phase 0 ["main"] (max max_iter 3) False,
 
         runWhen do_float_in CoreDoFloatInwards,
             -- Run float-inwards immediately before the strictness analyser
@@ -311,7 +311,7 @@ getCoreToDo dflags
 
         runWhen call_arity $ CoreDoPasses
             [ CoreDoCallArity
-            , simpl_phase 0 ["post-call-arity"] max_iter
+            , simpl_phase 0 ["post-call-arity"] max_iter False
             ],
 
         runWhen strictness demand_analyser,
@@ -342,7 +342,7 @@ getCoreToDo dflags
                 -- strictness analysis and the simplification which follows it.
         runWhen liberate_case (CoreDoPasses [
             CoreLiberateCase,
-            simpl_phase 0 ["post-liberate-case"] max_iter
+            simpl_phase 0 ["post-liberate-case"] max_iter False
             ]),         -- Run the simplifier after LiberateCase to vastly
                         -- reduce the possibility of shadowing
                         -- Reason: see Note [Shadowing] in SpecConstr.hs
@@ -352,11 +352,11 @@ getCoreToDo dflags
         maybe_rule_check (Phase 0),
 
         -- Final clean-up simplification:
-        simpl_phase 0 ["final"] max_iter,
+        simpl_phase 0 ["final"] max_iter True,
 
         runWhen late_dmd_anal $ CoreDoPasses (
             strictness_pass ++
-            [simpl_phase 0 ["post-late-ww"] max_iter]
+            [simpl_phase 0 ["post-late-ww"] max_iter False]
           ),
 
         -- Final run of the demand_analyser, ensures that one-shot thunks are



More information about the ghc-commits mailing list