Hoogle Search

Within LTS Haskell 24.38 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. exprOkForSpeculation :: CoreExpr -> Bool

    ghc GHC.Core.Utils

    To a first approximation, exprOkForSpeculation returns True of an expression that is:

    • Safe to evaluate even if normal order eval might not evaluate the expression at all, and
    • Safe not to evaluate even if normal order would do so
    More specifically, this means that: * A: Evaluation of the expression reaches weak-head-normal-form, * B: soon, * C: without causing a write side effect (e.g. writing a mutable variable). In particular, an expression that may * throw a synchronous Haskell exception, or * risk an unchecked runtime exception (e.g. array out of bounds, divide by zero) is not considered OK-for-speculation, as these violate condition A. For exprOkToDiscard, condition A is weakened to allow expressions that might risk an unchecked runtime exception but must otherwise reach weak-head-normal-form. (Note that exprOkForSpeculation implies exprOkToDiscard) But in fact both functions are a bit more conservative than the above, in at least the following ways:
    • W1: We do not take advantage of already-evaluated lifted variables. As a result, exprIsHNF DOES NOT imply exprOkForSpeculation; if y is a case-binder of lifted type, then exprIsHNF y is True, while exprOkForSpeculation y is False. See Note [exprOkForSpeculation and evaluated variables] for why.
    • W2: Read-effects on mutable variables are currently also included. See Note [Classifying primop effects] GHC.Builtin.PrimOps.
    • W3: Currently, exprOkForSpeculation always returns False for let-expressions. Lets can be stacked deeply, so we just give up. In any case, the argument of exprOkForSpeculation is usually in a strict context, so any lets will have been floated away.
    As an example of the considerations in this test, consider:
    let x = case y# +# 1# of { r# -> I# r# }
    in E
    
    being translated to:
    case y# +# 1# of { r# ->
    let x = I# r#
    in E
    }
    
    We can only do this if the y# +# 1# is ok for speculation: it has no side effects, and can't diverge or raise an exception. See also Note [Classifying primop effects] in GHC.Builtin.PrimOps and Note [Transformations affected by primop effects]. exprOkForSpeculation is used to define Core's let-can-float invariant. (See Note [Core let-can-float invariant] in GHC.Core.) It is therefore frequently called on arguments of unlifted type, especially via needsCaseBinding. But it is sometimes called on expressions of lifted type as well. For example, see Note [Speculative evaluation] in GHC.CoreToStg.Prep.

  2. shouldStrictifyIdForCbv :: Var -> Bool

    ghc GHC.Core.Utils

    Do we expect there to be any benefit if we make this var strict in order for it to get treated as as cbv argument? See Note [Which Ids should be strictified] See Note [CBV Function Ids] for more background.

  3. shouldUseCbvForId :: Var -> Bool

    ghc GHC.Core.Utils

    No documentation available.

  4. toIfaceForAllBndr :: VarBndr TyCoVar flag -> VarBndr IfaceBndr flag

    ghc GHC.CoreToIface

    No documentation available.

  5. toIfaceForAllBndrs :: [VarBndr TyCoVar vis] -> [VarBndr IfaceBndr vis]

    ghc GHC.CoreToIface

    No documentation available.

  6. coreToStg_platform :: CoreToStgOpts -> Platform

    ghc GHC.CoreToStg

    No documentation available.

  7. cp_platform :: CorePrepConfig -> Platform

    ghc GHC.CoreToStg.Prep

    No documentation available.

  8. module GHC.Data.BooleanFormula

    Boolean formulas without quantifiers and without negation. Such a formula consists of variables, conjunctions (and), and disjunctions (or). This module is used to represent minimal complete definitions for classes.

  9. data BooleanFormula a

    ghc GHC.Data.BooleanFormula

    No documentation available.

  10. type LBooleanFormula a = LocatedL BooleanFormula a

    ghc GHC.Data.BooleanFormula

    No documentation available.

Page 449 of many | Previous | Next