[commit: ghc] wip/T16039: noinline is not worth floating out (6c4fc36)

git at git.haskell.org git at git.haskell.org
Thu Dec 27 17:01:41 UTC 2018


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

On branch  : wip/T16039
Link       : http://ghc.haskell.org/trac/ghc/changeset/6c4fc3684ddc740abc847de815ffae3c023969ef/ghc

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

commit 6c4fc3684ddc740abc847de815ffae3c023969ef
Author: Gabor Greif <ggreif at gmail.com>
Date:   Wed Dec 12 11:21:25 2018 +0100

    noinline is not worth floating out
    
    this can be written more nicely


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

6c4fc3684ddc740abc847de815ffae3c023969ef
 compiler/simplCore/SetLevels.hs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/compiler/simplCore/SetLevels.hs b/compiler/simplCore/SetLevels.hs
index 2f993b7..e2aa945 100644
--- a/compiler/simplCore/SetLevels.hs
+++ b/compiler/simplCore/SetLevels.hs
@@ -100,6 +100,8 @@ import UniqDFM
 import FV
 import Data.Maybe
 import MonadUtils       ( mapAccumLM )
+import Unique (hasKey)
+import PrelNames (noinlineIdKey)
 
 {-
 ************************************************************************
@@ -967,6 +969,8 @@ notWorthFloating :: CoreExpr -> [Var] -> Bool
 -- we replace e with (lvl79 x y) and then run FloatOut again, don't want
 -- to replace (lvl79 x y) with (lvl83 x y)!
 
+notWorthFloating (App (App (Var v) Type{}) Var{}) _ | v `hasKey` noinlineIdKey = True
+
 notWorthFloating e abs_vars
   = go e (count isId abs_vars)
   where



More information about the ghc-commits mailing list