Skip to content
Snippets Groups Projects
Commit 228cc70f authored by sof's avatar sof
Browse files

[project @ 1998-07-20 16:11:57 by sof]

Provide option for allowing _casm_s to be unfolded across modules
parent 6a03d6f7
No related merge requests found
......@@ -35,7 +35,8 @@ import {-# SOURCE #-} MagicUFs ( MagicUnfoldingFun, mkMagicUnfoldingFun )
import CmdLineOpts ( opt_UnfoldingCreationThreshold,
opt_UnfoldingUseThreshold,
opt_UnfoldingConDiscount,
opt_UnfoldingKeenessFactor
opt_UnfoldingKeenessFactor,
opt_UnfoldCasms
)
import Constants ( uNFOLDING_CHEAP_OP_COST,
uNFOLDING_DEAR_OP_COST,
......@@ -563,7 +564,7 @@ file), but turning it off seems to the simplest thing to do.
\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
......@@ -593,7 +594,7 @@ okToUnfoldInHiFile e = go e
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}
......@@ -85,6 +85,7 @@ module CmdLineOpts (
opt_StgDoLetNoEscapes,
opt_InterfaceUnfoldThreshold,
opt_UnfoldCasms,
opt_UnfoldingCreationThreshold,
opt_UnfoldingConDiscount,
opt_UnfoldingUseThreshold,
......@@ -362,6 +363,7 @@ opt_ReturnInRegsThreshold = lookup_int "-freturn-in-regs-threshold"
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment