summaryrefslogtreecommitdiff
path: root/compiler/specialise/Specialise.lhs
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2009-11-19 12:57:11 +0000
committersimonpj@microsoft.com <unknown>2009-11-19 12:57:11 +0000
commit6a944ae7fe1e8e2e456c68717188463263f8978f (patch)
tree8a190b684af10b9e4fef1ed6ad397b0d346dc055 /compiler/specialise/Specialise.lhs
parentc93e8323ab49dd369e8b5f04027462a6fc1b8249 (diff)
downloadhaskell-6a944ae7fe1e8e2e456c68717188463263f8978f.tar.gz
Implement -fexpose-all-unfoldings, and fix a non-termination bug
The -fexpose-all-unfoldings flag arranges to put unfoldings for *everything* in the interface file. Of course, this makes the file a lot bigger, but it also makes it complete, and that's great for supercompilation; or indeed any whole-program work. Consequences: * Interface files need to record loop-breaker-hood. (Previously, loop breakers were never exposed, so that info wasn't necessary.) Hence a small interface file format change. * When inlining, must check loop-breaker-hood. (Previously, loop breakers didn't have an unfolding at all, so no need to check.) * Ditto in exprIsConApp_maybe. Roman actually tripped this bug, because a DFun, which had an unfolding, was also a loop breaker * TidyPgm.tidyIdInfo must be careful to preserve loop-breaker-hood So Id.idUnfolding checks for loop-breaker-hood and returns NoUnfolding if so. When you want the unfolding regardless of loop-breaker-hood, use Id.realIdUnfolding. I have not documented the flag yet, because it's experimental. Nor have I tested it thoroughly. But with the flag off (the normal case) everything should work.
Diffstat (limited to 'compiler/specialise/Specialise.lhs')
-rw-r--r--compiler/specialise/Specialise.lhs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/specialise/Specialise.lhs b/compiler/specialise/Specialise.lhs
index b772a3f25c..6d071e22b6 100644
--- a/compiler/specialise/Specialise.lhs
+++ b/compiler/specialise/Specialise.lhs
@@ -800,7 +800,7 @@ specDefn subst body_uds fn rhs
where
fn_type = idType fn
fn_arity = idArity fn
- fn_unf = idUnfolding fn
+ fn_unf = realIdUnfolding fn -- Ignore loop-breaker-ness here
(tyvars, theta, _) = tcSplitSigmaTy fn_type
n_tyvars = length tyvars
n_dicts = length theta