Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
e1e1c413
Commit
e1e1c413
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-09-04 20:07:13 by sof]
doc update
parent
44616f4e
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/simplCore/OccurAnal.lhs
+23
-1
23 additions, 1 deletion
ghc/compiler/simplCore/OccurAnal.lhs
with
23 additions
and
1 deletion
ghc/compiler/simplCore/OccurAnal.lhs
+
23
−
1
View file @
e1e1c413
...
...
@@ -425,10 +425,32 @@ Here's a case that bit me:
...a...a...a....
Re-ordering doesn't change the order of bindings, but there was no loop-breaker.
(The first binding was a var-rhs; the second was a one-occ.) So the simplifier looped.
My solution was to make a=b bindings record b as Many, rather like INLINE bindings.
Perhaps something cleverer would suffice.
You might think that you can prevent non-termination simply by making
sure that we simplify a recursive binding's RHS in an environment that
simply clones the recursive Id. But no. Consider
letrec f = \x -> let z = f x' in ...
in
let n = f y
in
case n of { ... }
We bind n to its *simplified* RHS, we then *re-simplify* it when
we inline n. Then we may well inline f; and then the same thing
happens with z!
I don't think it's possible to prevent non-termination by environment
manipulation in this way. Apart from anything else, successive
iterations of the simplifier may unroll recursive loops in cases like
that above. The idea of beaking every recursive loop with an
IMustNotBeINLINEd pragma is much much better.
\begin{code}
reOrderRec
:: OccEnv
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment