[commit: ghc] : Handle ConApp in inlineBoringOk (518ed79)
git at git.haskell.org
git at git.haskell.org
Mon Oct 10 21:43:18 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch :
Link : http://ghc.haskell.org/trac/ghc/changeset/518ed7909a9c81d96480b9ed2fd39a0be2fb8fe3/ghc
>---------------------------------------------------------------
commit 518ed7909a9c81d96480b9ed2fd39a0be2fb8fe3
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Sat Oct 8 22:55:54 2016 -0400
Handle ConApp in inlineBoringOk
>---------------------------------------------------------------
518ed7909a9c81d96480b9ed2fd39a0be2fb8fe3
compiler/coreSyn/CoreUnfold.hs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs
index 7170997..56fd3ca 100644
--- a/compiler/coreSyn/CoreUnfold.hs
+++ b/compiler/coreSyn/CoreUnfold.hs
@@ -321,7 +321,9 @@ inlineBoringOk e
go credit (App f (Type {})) = go credit f
go credit (App f a) | credit > 0
, exprIsTrivial a = go (credit-1) f
- go credit (Tick _ e) = go credit e -- dubious
+ go credit (ConApp dc args) = all exprIsTrivial args &&
+ credit >= dataConRepArity dc
+ go credit (Tick _ e) = go credit e -- dubious
go credit (Cast e _) = go credit e
go _ (Var {}) = boringCxtOk
go _ _ = boringCxtNotOk
More information about the ghc-commits
mailing list