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

git at git.haskell.org git at git.haskell.org
Sun Mar 31 15:07:10 UTC 2019


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

On branch  : wip/T16039
Link       : http://ghc.haskell.org/trac/ghc/changeset/19a0b1244740b71bae24a28415364344b4246b7a/ghc

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

commit 19a0b1244740b71bae24a28415364344b4246b7a
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


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

19a0b1244740b71bae24a28415364344b4246b7a
 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