From: sof Date: Mon, 20 Jul 1998 16:12:01 +0000 (+0000) Subject: [project @ 1998-07-20 16:11:57 by sof] X-Git-Tag: Approx_2487_patches~509 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=228cc70f790077255b6de9c425b65f1732e710d7;p=ghc-hetmet.git [project @ 1998-07-20 16:11:57 by sof] Provide option for allowing _casm_s to be unfolded across modules --- diff --git a/ghc/compiler/coreSyn/CoreUnfold.lhs b/ghc/compiler/coreSyn/CoreUnfold.lhs index 55b285b..c165062 100644 --- a/ghc/compiler/coreSyn/CoreUnfold.lhs +++ b/ghc/compiler/coreSyn/CoreUnfold.lhs @@ -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} diff --git a/ghc/compiler/main/CmdLineOpts.lhs b/ghc/compiler/main/CmdLineOpts.lhs index fa3c878..9fa7b60 100644 --- a/ghc/compiler/main/CmdLineOpts.lhs +++ b/ghc/compiler/main/CmdLineOpts.lhs @@ -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