summaryrefslogtreecommitdiff
path: root/ghc/compiler/specialise
diff options
context:
space:
mode:
authorsimonpj <unknown>1999-07-06 16:46:12 +0000
committersimonpj <unknown>1999-07-06 16:46:12 +0000
commit9d38678ea60ff32f756390a30c659daa22c98c93 (patch)
tree520970e39a3c81cdeb22271b83e576e726abdb37 /ghc/compiler/specialise
parent47a40c89ca2e588b62d986a58907e178bce1de4f (diff)
downloadhaskell-9d38678ea60ff32f756390a30c659daa22c98c93.tar.gz
[project @ 1999-07-06 16:45:31 by simonpj]
All Simon's recent tuning changes. Rough summary follows: * Fix Kevin Atkinson's cant-find-instance bug. Turns out that Rename.slurpSourceRefs needs to repeatedly call getImportedInstDecls, and then go back to slurping source-refs. Comments with Rename.slurpSourceRefs. * Add a case to Simplify.mkDupableAlt for the quite-common case where there's a very simple alternative, in which case there's no point in creating a join-point binding. * Fix CoreUtils.exprOkForSpeculation so that it returns True of (==# a# b#). This lack meant that case ==# a# b# of { True -> x; False -> x } was not simplifying * Make float-out dump bindings at the top of a function argument, as at the top of a let(rec) rhs. See notes with FloatOut.floatRhs * Make the ArgOf case of mkDupableAlt generate a OneShot lambda. This gave a noticeable boost to spectral/boyer2 * Reduce the number of coerces, using worker/wrapper stuff. The main idea is in WwLib.mkWWcoerce. The gloss is that we must do the w/w split even for small non-recursive things. See notes with WorkWrap.tryWw. * This further complicated getWorkerId, so I finally bit the bullet and make the workerInfo field of the IdInfo work properly, including under substitutions. Death to getWorkerId. Kevin Glynn will be happy. * Make all lambdas over realWorldStatePrimTy into one-shot lambdas. This is a GROSS HACK. * Also make the occurrence analyser aware of one-shot lambdas. * Make various Prelude things into INLINE, so that foldr doesn't get inlined in their body, so that the caller gets the benefit of fusion. Notably in PrelArr.lhs.
Diffstat (limited to 'ghc/compiler/specialise')
-rw-r--r--ghc/compiler/specialise/Rules.lhs14
1 files changed, 13 insertions, 1 deletions
diff --git a/ghc/compiler/specialise/Rules.lhs b/ghc/compiler/specialise/Rules.lhs
index 99da2e2d70..8406b0a498 100644
--- a/ghc/compiler/specialise/Rules.lhs
+++ b/ghc/compiler/specialise/Rules.lhs
@@ -159,7 +159,17 @@ matchRule in_scope (Rule rn tpl_vars tpl_args rhs) args
-- One tiresome way to terminate: check for excess unmatched
-- template arguments
- go tpl_args [] subst
+ go tpl_args [] subst = Nothing -- Failure
+
+
+{- The code below tries to match even if there are more
+ template args than real args.
+
+ I now think this is probably a bad idea.
+ Should the template (map f xs) match (map g)? I think not.
+ For a start, in general eta expansion wastes work.
+ SLPJ July 99
+
= case eta_complete tpl_args (mkVarSet leftovers) of
Just leftovers' -> Just (rn, mkLams done (mkLams leftovers' rhs),
mk_result_args subst done)
@@ -188,6 +198,7 @@ matchRule in_scope (Rule rn tpl_vars tpl_args rhs) args
Nothing -> Nothing
eta_complete other vars = Nothing
+-}
-----------------------
mk_result_args subst vs = map go vs
@@ -198,6 +209,7 @@ matchRule in_scope (Rule rn tpl_vars tpl_args rhs) args
Just (DoneTy ty) -> Type ty
-- Substitution should bind them all!
+
zapOccInfo bndr | isTyVar bndr = bndr
| otherwise = maybeModifyIdInfo zapLamIdInfo bndr
\end{code}