import CmdLineOpts ( opt_UnfoldingCreationThreshold,
opt_UnfoldingUseThreshold,
opt_UnfoldingConDiscount,
- opt_UnfoldingKeenessFactor
+ opt_UnfoldingKeenessFactor,
+ opt_UnfoldCasms
)
import Constants ( uNFOLDING_CHEAP_OP_COST,
uNFOLDING_DEAR_OP_COST,
\begin{code}
okToUnfoldInHiFile :: CoreExpr -> Bool
-okToUnfoldInHiFile e = go e
+okToUnfoldInHiFile e = opt_UnfoldCasms || go e
where
-- Race over an expression looking for CCalls..
go (Var _) = True
BindDefault _ rhs -> rhs:ls
-- ok to unfold a PrimOp as long as it's not a _casm_
- okToUnfoldPrimOp (CCallOp _ is_casm _ _ _) = not is_casm
- okToUnfoldPrimOp _ = True
+ okToUnfoldPrimOp (CCallOp _ is_casm _ _ _ _) = not is_casm
+ okToUnfoldPrimOp _ = True
\end{code}
opt_StgDoLetNoEscapes,
opt_InterfaceUnfoldThreshold,
+ opt_UnfoldCasms,
opt_UnfoldingCreationThreshold,
opt_UnfoldingConDiscount,
opt_UnfoldingUseThreshold,
opt_SccGroup = lookup_str "-G="
opt_Verbose = lookUp SLIT("-v")
+opt_UnfoldCasms = lookUp SLIT("-funfold-casms-in-hi-file")
opt_InterfaceUnfoldThreshold = lookup_def_int "-funfolding-interface-threshold" iNTERFACE_UNFOLD_THRESHOLD
opt_UnfoldingCreationThreshold = lookup_def_int "-funfolding-creation-threshold" uNFOLDING_CREATION_THRESHOLD
opt_UnfoldingUseThreshold = lookup_def_int "-funfolding-use-threshold" uNFOLDING_USE_THRESHOLD