diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs index 4fbf3ca18451b714637f702927760ca6f833b242..0e7996eea97116cfa0634e1312d0d642d3766076 100644 --- a/compiler/basicTypes/Demand.lhs +++ b/compiler/basicTypes/Demand.lhs @@ -27,9 +27,9 @@ module Demand ( peelFV, DmdResult, CPRResult, - isBotRes, isTopRes, resTypeArgDmd, + isBotRes, isTopRes, resTypeArgDmd, topRes, convRes, botRes, cprProdRes, vanillaCprProdRes, cprSumRes, - appIsBottom, isBottomingSig, isConvSig, pprIfaceStrictSig, + appIsBottom, isBottomingSig, isConvSig, pprIfaceStrictSig, trimCPRInfo, returnsCPR, returnsCPR_maybe, StrictSig(..), mkStrictSig, mkClosedStrictSig, nopSig, botSig, cprProdSig, convergeSig, isNopSig, splitStrictSig, increaseStrictSigArity, @@ -812,6 +812,10 @@ isBotRes :: DmdResult -> Bool isBotRes Diverges = True isBotRes _ = False +isConvRes :: DmdResult -> Bool +isConvRes (Converges {}) = True +isConvRes _ = False + trimCPRInfo :: Bool -> Bool -> DmdResult -> DmdResult trimCPRInfo trim_all trim_sums res = trimR res @@ -1439,6 +1443,9 @@ isNopSig (StrictSig ty) = isNopDmdType ty isBottomingSig :: StrictSig -> Bool isBottomingSig (StrictSig (DmdType _ _ res)) = isBotRes res +isConvSig :: StrictSig -> Bool +isConvSig (StrictSig (DmdType _ _ res)) = isConvRes res + nopSig, botSig :: StrictSig nopSig = StrictSig nopDmdType botSig = StrictSig botDmdType diff --git a/compiler/basicTypes/Id.lhs b/compiler/basicTypes/Id.lhs index 50b36419585b8c29fdc4b25347b3ec24472c9ed5..9ad99f3e9956ac12b95967f44f95062b9e5f9d94 100644 --- a/compiler/basicTypes/Id.lhs +++ b/compiler/basicTypes/Id.lhs @@ -47,7 +47,7 @@ module Id ( -- ** Predicates on Ids isImplicitId, isDeadBinder, - isStrictId, + isStrictId, isConvId, isExportedId, isLocalId, isGlobalId, isRecordSelector, isNaughtyRecordSelector, isClassOpId_maybe, isDFunId, @@ -495,6 +495,11 @@ isStrictId id -- Take the best of both strictnesses - old and new (isStrictDmd (idDemandInfo id)) +isConvId :: Id -> Bool +isConvId id + = ASSERT2( isId id, text "isConvId: not an id: " <+> ppr id ) + (isConvSig (idStrictness id)) + --------------------------------- -- UNFOLDING idUnfolding :: Id -> Unfolding diff --git a/compiler/simplCore/Simplify.lhs b/compiler/simplCore/Simplify.lhs index 03150c6e12373a076f413f024fef84aea5059f97..422e3d07ad6bc34a7b92c08ae0bc41608928d224 100644 --- a/compiler/simplCore/Simplify.lhs +++ b/compiler/simplCore/Simplify.lhs @@ -1347,7 +1347,7 @@ simplNonRecE env bndr (rhs, rhs_se) (bndrs, body) cont ; -- pprTrace "preInlineUncond" (ppr bndr <+> ppr rhs) $ simplLam (extendIdSubst env bndr (mkContEx rhs_se rhs)) bndrs body cont } - | isStrictId bndr -> -- Includes coercions + | isStrictId bndr || isConvId bndr -> -- Includes coercions do { simplExprF (rhs_se `setFloats` env) rhs (StrictBind bndr bndrs body env cont) }