[commit: ghc] wip/T9732: Avoid premature unfolding of `seq` (df5ca31)

git at git.haskell.org git at git.haskell.org
Thu Nov 13 10:53:08 UTC 2014


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

On branch  : wip/T9732
Link       : http://ghc.haskell.org/trac/ghc/changeset/df5ca319629577c2fdfc3dce0b0e9c49ac8f9cdf/ghc

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

commit df5ca319629577c2fdfc3dce0b0e9c49ac8f9cdf
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date:   Thu Nov 13 17:39:03 2014 +0800

    Avoid premature unfolding of `seq`


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

df5ca319629577c2fdfc3dce0b0e9c49ac8f9cdf
 compiler/basicTypes/MkId.lhs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/basicTypes/MkId.lhs b/compiler/basicTypes/MkId.lhs
index b32a2b7..738b195 100644
--- a/compiler/basicTypes/MkId.lhs
+++ b/compiler/basicTypes/MkId.lhs
@@ -1088,7 +1088,7 @@ seqId :: Id     -- See Note [seqId magic]
 seqId = pcMiscPrelId seqName ty info
   where
     info = noCafIdInfo `setInlinePragInfo` alwaysInlinePragma
-                       `setUnfoldingInfo`  mkCompulsoryUnfolding rhs
+                       `setUnfoldingInfo`  mkInlineUnfolding (Just 2) rhs
                        `setSpecInfo`       mkSpecInfo [seq_cast_rule]
 
 
@@ -1097,7 +1097,7 @@ seqId = pcMiscPrelId seqName ty info
               -- NB argBetaTyVar; see Note [seqId magic]
 
     [x,y] = mkTemplateLocals [alphaTy, betaTy]
-    rhs = mkLams [alphaTyVar,betaTyVar,x,y] (Case (Var x) x betaTy [(DEFAULT, [], Var y)])
+    rhs = mkLams [alphaTyVar,openBetaTyVar,x,y] (Case (Var x) x betaTy [(DEFAULT, [], Var y)])
 
     -- See Note [Built-in RULES for seq]
     seq_cast_rule = BuiltinRule { ru_name  = fsLit "seq of cast"



More information about the ghc-commits mailing list