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.
exprOkForSpeculation :: CoreExpr -> Boolghc 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
- 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.
let x = case y# +# 1# of { r# -> I# r# } in Ebeing 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.shouldStrictifyIdForCbv :: Var -> Boolghc 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.
shouldUseCbvForId :: Var -> Boolghc GHC.Core.Utils No documentation available.
toIfaceForAllBndr :: VarBndr TyCoVar flag -> VarBndr IfaceBndr flagghc GHC.CoreToIface No documentation available.
toIfaceForAllBndrs :: [VarBndr TyCoVar vis] -> [VarBndr IfaceBndr vis]ghc GHC.CoreToIface No documentation available.
coreToStg_platform :: CoreToStgOpts -> Platformghc GHC.CoreToStg No documentation available.
cp_platform :: CorePrepConfig -> Platformghc GHC.CoreToStg.Prep No documentation available.
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.
-
ghc GHC.Data.BooleanFormula No documentation available.
type
LBooleanFormula a = LocatedL BooleanFormula aghc GHC.Data.BooleanFormula No documentation available.