[commit: ghc] master: Comments and equation ordering only (d2959df)
git at git.haskell.org
git at git.haskell.org
Wed Oct 12 14:26:55 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/d2959dfbbbc33a0a44c498d1e6b424615b7d756d/ghc
>---------------------------------------------------------------
commit d2959dfbbbc33a0a44c498d1e6b424615b7d756d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Wed Oct 12 15:26:24 2016 +0100
Comments and equation ordering only
>---------------------------------------------------------------
d2959dfbbbc33a0a44c498d1e6b424615b7d756d
compiler/coreSyn/CorePrep.hs | 6 ++++--
compiler/coreSyn/CoreUtils.hs | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/compiler/coreSyn/CorePrep.hs b/compiler/coreSyn/CorePrep.hs
index b3d7817..510b178 100644
--- a/compiler/coreSyn/CorePrep.hs
+++ b/compiler/coreSyn/CorePrep.hs
@@ -920,8 +920,10 @@ of the scope of a `seq`, or dropped the `seq` altogether.
-}
cpe_ExprIsTrivial :: CoreExpr -> Bool
--- Version that doesn't consider an scc annotation to be trivial.
--- See also 'exprIsTrivial'
+-- This function differs from CoreUtils.exprIsTrivial only in its
+-- treatment of (Lit l). Otherwise it's identical.
+-- No one knows why this difference is important: Trac #11158.
+-- Someone should find out
cpe_ExprIsTrivial (Var _) = True
cpe_ExprIsTrivial (Type _) = True
cpe_ExprIsTrivial (Coercion _) = True
diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs
index 6a28b9f..a128737 100644
--- a/compiler/coreSyn/CoreUtils.hs
+++ b/compiler/coreSyn/CoreUtils.hs
@@ -803,10 +803,10 @@ exprIsTrivial (Type _) = True
exprIsTrivial (Coercion _) = True
exprIsTrivial (Lit lit) = litIsTrivial lit
exprIsTrivial (App e arg) = not (isRuntimeArg arg) && exprIsTrivial e
+exprIsTrivial (Lam b e) = not (isRuntimeVar b) && exprIsTrivial e
exprIsTrivial (Tick t e) = not (tickishIsCode t) && exprIsTrivial e
-- See Note [Tick trivial]
exprIsTrivial (Cast e _) = exprIsTrivial e
-exprIsTrivial (Lam b body) = not (isRuntimeVar b) && exprIsTrivial body
exprIsTrivial (Case e _ _ []) = exprIsTrivial e -- See Note [Empty case is trivial]
exprIsTrivial _ = False
More information about the ghc-commits
mailing list