[commit: ghc] master: Tiny refactor (1163f4f)

git at git.haskell.org git at git.haskell.org
Mon Mar 6 15:20:52 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/1163f4f2fe9aabd722c963497c67c5f8c71ef71b/ghc

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

commit 1163f4f2fe9aabd722c963497c67c5f8c71ef71b
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Mar 3 12:51:21 2017 +0000

    Tiny refactor


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

1163f4f2fe9aabd722c963497c67c5f8c71ef71b
 compiler/simplCore/OccurAnal.hs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs
index 3aaa1f3..c828249 100644
--- a/compiler/simplCore/OccurAnal.hs
+++ b/compiler/simplCore/OccurAnal.hs
@@ -1357,13 +1357,13 @@ nodeScore old_bndr new_bndr bind_rhs lb_deps
   = mk_score 5       -- Note [Constructor applications]
 
   | isStableUnfolding id_unfolding
-  , canUnfold id_unfolding
+  , can_unfold
   = mk_score 3
 
   | isOneOcc (idOccInfo new_bndr)
   = mk_score 2  -- Likely to be inlined
 
-  | canUnfold id_unfolding  -- The Id has some kind of unfolding
+  | can_unfold  -- The Id has some kind of unfolding
   = mk_score 1
 
   | otherwise
@@ -1386,6 +1386,7 @@ nodeScore old_bndr new_bndr bind_rhs lb_deps
                     -> size
                  _  -> cheapExprSize rhs
 
+    can_unfold   = canUnfold id_unfolding
     id_unfolding = realIdUnfolding old_bndr
        -- realIdUnfolding: Ignore loop-breaker-ness here because
        -- that is what we are setting!



More information about the ghc-commits mailing list