[project @ 2001-05-04 08:10:30 by simonpj]
authorsimonpj <unknown>
Fri, 4 May 2001 08:10:31 +0000 (08:10 +0000)
committersimonpj <unknown>
Fri, 4 May 2001 08:10:31 +0000 (08:10 +0000)
Comments only

ghc/compiler/coreSyn/CoreUtils.lhs
ghc/compiler/prelude/TysWiredIn.lhs
ghc/compiler/specialise/Rules.lhs
ghc/compiler/typecheck/TcInstDcls.lhs

index 9abad8f..4d3ae6d 100644 (file)
@@ -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,
index b0ebb94..5769505 100644 (file)
@@ -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}
 
 
index 4e028e7..d07dad6 100644 (file)
@@ -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!!
index d4dd386..324ee71 100644 (file)
@@ -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