[commit: ghc] wip/T12618: Make data con wrappers ConLike (and see what happens) (f8312ea)
git at git.haskell.org
git at git.haskell.org
Tue Oct 11 23:04:12 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T12618
Link : http://ghc.haskell.org/trac/ghc/changeset/f8312ea10d2dcfc87034e6497e21fb324f3ce827/ghc
>---------------------------------------------------------------
commit f8312ea10d2dcfc87034e6497e21fb324f3ce827
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Tue Oct 11 19:03:51 2016 -0400
Make data con wrappers ConLike (and see what happens)
>---------------------------------------------------------------
f8312ea10d2dcfc87034e6497e21fb324f3ce827
compiler/basicTypes/MkId.hs | 4 ++--
compiler/simplCore/Simplify.hs | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs
index edbfc5a..c0d38cc 100644
--- a/compiler/basicTypes/MkId.hs
+++ b/compiler/basicTypes/MkId.hs
@@ -491,7 +491,7 @@ mkSimpleDataConRep wrap_name dc
`setArityInfo` wrap_arity
-- It's important to specify the arity, so that partial
-- applications are treated as values
- `setInlinePragInfo` alwaysInlinePragma
+ `setInlinePragInfo` alwaysInlinePragma { inl_rule = ConLike }
`setUnfoldingInfo` wrap_unf
`setStrictnessInfo` wrap_sig
wrap_arity = dataConRepArity dc
@@ -535,7 +535,7 @@ mkDataConRep dflags fam_envs wrap_name mb_bangs data_con
`setArityInfo` wrap_arity
-- It's important to specify the arity, so that partial
-- applications are treated as values
- `setInlinePragInfo` alwaysInlinePragma
+ `setInlinePragInfo` alwaysInlinePragma { inl_rule = ConLike }
`setUnfoldingInfo` wrap_unf
`setStrictnessInfo` wrap_sig
-- We need to get the CAF info right here because TidyPgm
diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs
index 637139c..d33ddb2 100644
--- a/compiler/simplCore/Simplify.hs
+++ b/compiler/simplCore/Simplify.hs
@@ -489,7 +489,8 @@ prepareRhs top_lvl env0 id rhs0
go n_val_args env (Var fun)
= return (is_exp, env, Var fun)
where
- is_exp = isExpandableApp fun n_val_args -- The fun a constructor or PAP
+ is_exp = pprTrace "prepareRhs:isExpandableApp" (ppr fun <+> ppr (isExpandableApp fun n_val_args)) $
+ isExpandableApp fun n_val_args -- The fun a constructor or PAP
-- See Note [CONLIKE pragma] in BasicTypes
-- The definition of is_exp should match that in
-- OccurAnal.occAnalApp
More information about the ghc-commits
mailing list