From: simonpj Date: Fri, 4 May 2001 08:10:31 +0000 (+0000) Subject: [project @ 2001-05-04 08:10:30 by simonpj] X-Git-Tag: Approximately_9120_patches~2000 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=cf158e40f528a008226e730f1e47ca6efa9ea8ad;p=ghc-hetmet.git [project @ 2001-05-04 08:10:30 by simonpj] Comments only --- diff --git a/ghc/compiler/coreSyn/CoreUtils.lhs b/ghc/compiler/coreSyn/CoreUtils.lhs index 9abad8f..4d3ae6d 100644 --- a/ghc/compiler/coreSyn/CoreUtils.lhs +++ b/ghc/compiler/coreSyn/CoreUtils.lhs @@ -561,7 +561,12 @@ idAppIsValue id n_val_args \begin{code} exprIsConApp_maybe :: CoreExpr -> Maybe (DataCon, [CoreExpr]) exprIsConApp_maybe (Note InlineMe expr) = exprIsConApp_maybe expr -exprIsConApp_maybe expr = analyse (collectArgs expr) + -- We ignore InlineMe notes in case we have + -- x = __inline_me__ (a,b) + -- All part of making sure that INLINE pragmas never hurt + -- Marcin tripped on this one when making dictionaries more inlinable + +exprIsConApp_maybe expr = analyse (collectArgs expr) where analyse (Var fun, args) | Just con <- isDataConId_maybe fun, diff --git a/ghc/compiler/prelude/TysWiredIn.lhs b/ghc/compiler/prelude/TysWiredIn.lhs index b0ebb94..5769505 100644 --- a/ghc/compiler/prelude/TysWiredIn.lhs +++ b/ghc/compiler/prelude/TysWiredIn.lhs @@ -154,8 +154,8 @@ genericTyCons :: [TyCon] genericTyCons = [ plusTyCon, crossTyCon, genUnitTyCon ] -tuple_tycons = unitTyCon : [tupleTyCon Boxed i | i <- [2..37] ] -unboxed_tuple_tycons = [tupleTyCon Unboxed i | i <- [1..37] ] +tuple_tycons = unitTyCon : [tupleTyCon Boxed i | i <- [2..mAX_TUPLE_SIZE] ] +unboxed_tuple_tycons = [tupleTyCon Unboxed i | i <- [1..mAX_TUPLE_SIZE] ] \end{code} diff --git a/ghc/compiler/specialise/Rules.lhs b/ghc/compiler/specialise/Rules.lhs index 4e028e7..d07dad6 100644 --- a/ghc/compiler/specialise/Rules.lhs +++ b/ghc/compiler/specialise/Rules.lhs @@ -483,7 +483,13 @@ extendRuleBase (RuleBase rule_ids rule_fvs) (id, rule) (rule_fvs `unionVarSet` extendVarSet lhs_fvs id) where new_id = setIdSpecialisation id (addRule old_rules id rule) + old_rules = idSpecialisation (fromMaybe id (lookupVarSet rule_ids id)) + -- Get the old rules from rule_ids if the Id is already there, but + -- if not, use the Id from the incoming rule. If may be a PrimOpId, + -- in which case it may have rules in its belly already. Seems + -- dreadfully hackoid. + lhs_fvs = ruleLhsFreeIds rule -- Finds *all* the free Ids of the LHS, not just -- locally defined ones!! diff --git a/ghc/compiler/typecheck/TcInstDcls.lhs b/ghc/compiler/typecheck/TcInstDcls.lhs index d4dd386..324ee71 100644 --- a/ghc/compiler/typecheck/TcInstDcls.lhs +++ b/ghc/compiler/typecheck/TcInstDcls.lhs @@ -603,6 +603,10 @@ tcInstDecl2 (InstInfo { iDFunId = dfun_id, scs_and_meths = map instToId (sc_dicts ++ meth_insts) this_dict_id = instToId this_dict inlines = unitNameSet (idName dfun_id) + -- Always inline the dfun; this is an experimental decision + -- because it makes a big performance difference sometimes. + -- Often it means we can do the method selection, and then + -- inline the method as well. Marcin's idea. dict_rhs | null scs_and_meths