summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Opt
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Core/Opt')
-rw-r--r--compiler/GHC/Core/Opt/Arity.hs2
-rw-r--r--compiler/GHC/Core/Opt/DmdAnal.hs6
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/GHC/Core/Opt/Arity.hs b/compiler/GHC/Core/Opt/Arity.hs
index b12478cbab..fbbcf1c2ad 100644
--- a/compiler/GHC/Core/Opt/Arity.hs
+++ b/compiler/GHC/Core/Opt/Arity.hs
@@ -2677,7 +2677,7 @@ tryEtaReduce rec_ids bndrs body eval_sd
-- ... and that the function can be eta reduced to arity 0
-- without violating invariants of Core and GHC
&& canEtaReduceToArity fun 0 0 -- criteria (L), (J), (W), (B)
- all_calls_with_arity n = isStrict (peelManyCalls n eval_sd)
+ all_calls_with_arity n = isStrict (fst $ peelManyCalls n eval_sd)
-- See Note [Eta reduction based on evaluation context]
---------------
diff --git a/compiler/GHC/Core/Opt/DmdAnal.hs b/compiler/GHC/Core/Opt/DmdAnal.hs
index a14964c12e..74316e1e1b 100644
--- a/compiler/GHC/Core/Opt/DmdAnal.hs
+++ b/compiler/GHC/Core/Opt/DmdAnal.hs
@@ -982,9 +982,9 @@ dmdTransform :: AnalEnv -- ^ The analysis environment
-- See Note [What are demand signatures?] in "GHC.Types.Demand"
dmdTransform env var sd
-- Data constructors
- | isDataConWorkId var
- = -- pprTraceWith "dmdTransform:DataCon" (\ty -> ppr var $$ ppr sd $$ ppr ty) $
- dmdTransformDataConSig (idArity var) sd
+ | Just con <- isDataConWorkId_maybe var
+ = -- pprTraceWith "dmdTransform:DataCon" (\ty -> ppr con $$ ppr sd $$ ppr ty) $
+ dmdTransformDataConSig (dataConRepStrictness con) sd
-- See Note [DmdAnal for DataCon wrappers]
| isDataConWrapId var, let rhs = uf_tmpl (realIdUnfolding var)
, WithDmdType dmd_ty _rhs' <- dmdAnal env sd rhs