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

git at git.haskell.org git at git.haskell.org
Thu Nov 13 09:43:21 UTC 2014


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

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

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

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

    Avoid premature unfolding of `seq`


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

bbefa6d2f2ee57f56ef7d0f5bc636818460c9165
 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 9fc728b..011df11 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