Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
64bfc011
Commit
64bfc011
authored
Jan 21, 2008
by
simonpj@microsoft.com
Browse files
Wibble to the OccurAnal fix for RULEs and loop-breakers
parent
eea143f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/simplCore/OccurAnal.lhs
View file @
64bfc011
...
...
@@ -221,7 +221,7 @@ However things are made quite a bit more complicated by RULES. Remember
Remmber that we simplify the RULES before any RHS (see Note
[Rules are visible in their own rec group] above).
So we must *not* postInlineUnconditi
n
oally 'g', even though
So we must *not* postInlineUnconditio
n
ally 'g', even though
its RHS turns out to be trivial. (I'm assuming that 'g' is
not choosen as a loop breaker.)
...
...
@@ -235,7 +235,7 @@ However things are made quite a bit more complicated by RULES. Remember
other yes yes
The **sole** reason for this kind of loop breaker is so that
postInlineUnconditio
a
nlly does not fire. Ugh.
postInlineUncondition
a
lly does not fire. Ugh.
* Note [Rule dependency info]
~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
@@ -307,10 +307,14 @@ occAnalBind env (Rec pairs) body_usage
= body_usage +++ addRuleUsage rhs_usage bndr
(final_usage, tagged_bndrs) = tagBinders total_usage bndrs
final_bndrs |
no
_rules
= tagged_bndrs
final_bndrs |
isEmptyVarSet all
_rule
_fv
s = tagged_bndrs
| otherwise = map tag_rule_var tagged_bndrs
tag_rule_var bndr | bndr `elemVarSet` all_rule_fvs = makeLoopBreaker True bndr
| otherwise = bndr
all_rule_fvs = bndr_set `intersectVarSet` foldr (unionVarSet . idRuleVars) emptyVarSet bndrs
-- Mark the binder with OccInfo saying "no preInlineUnconditionally" if
-- it is used in any rule (lhs or rhs) of the recursive group
---- stuff for dependency analysis of binds -------------------------------
sccs :: [SCC (Node Details)]
...
...
@@ -353,7 +357,6 @@ occAnalBind env (Rec pairs) body_usage
rule_fv_env = rule_loop init_rule_fvs
no_rules = null init_rule_fvs
all_rule_fvs = foldr (unionVarSet . snd) emptyVarSet init_rule_fvs
init_rule_fvs = [(b, rule_fvs)
| b <- bndrs
, let rule_fvs = idRuleRhsVars b `intersectVarSet` bndr_set
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment