[commit: ghc] master: refactor tick handling a little (36dbf27)

git at git.haskell.org git at git.haskell.org
Thu Nov 21 13:25:11 UTC 2013


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/36dbf27fbafe083dbb94c58fc12a7e2484e1c9aa/ghc

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

commit 36dbf27fbafe083dbb94c58fc12a7e2484e1c9aa
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Thu Nov 21 09:59:40 2013 +0000

    refactor tick handling a little


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

36dbf27fbafe083dbb94c58fc12a7e2484e1c9aa
 compiler/simplCore/Simplify.lhs |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/compiler/simplCore/Simplify.lhs b/compiler/simplCore/Simplify.lhs
index 8a5a77b..25d765f 100644
--- a/compiler/simplCore/Simplify.lhs
+++ b/compiler/simplCore/Simplify.lhs
@@ -1051,9 +1051,8 @@ simplTick env tickish expr cont
                         _ -> False
 
   push_tick_inside t expr0
-     | not (tickishCanSplit t) = Nothing
-     | otherwise
-       = case expr0 of
+       = ASSERT(tickishScoped t)
+         case expr0 of
            Tick t' expr
               -- scc t (tick t' E)
               --   Pull the tick to the outside
@@ -1070,9 +1069,11 @@ simplTick env tickish expr cont
               | otherwise -> Nothing
 
            Case scrut bndr ty alts
-              -> Just (Case (mkTick t scrut) bndr ty alts')
+              | not (tickishCanSplit t) -> Nothing
+              | otherwise -> Just (Case (mkTick t scrut) bndr ty alts')
              where t_scope = mkNoCount t -- drop the tick on the dup'd ones
                    alts'   = [ (c,bs, mkTick t_scope e) | (c,bs,e) <- alts]
+
            _other -> Nothing
     where
 



More information about the ghc-commits mailing list