projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d617e38
)
Comments only
author
simonpj@microsoft.com
<unknown>
Fri, 5 Dec 2008 10:24:37 +0000
(10:24 +0000)
committer
simonpj@microsoft.com
<unknown>
Fri, 5 Dec 2008 10:24:37 +0000
(10:24 +0000)
compiler/simplCore/CSE.lhs
patch
|
blob
|
history
diff --git
a/compiler/simplCore/CSE.lhs
b/compiler/simplCore/CSE.lhs
index
8b5825b
..
9b90220
100644
(file)
--- a/
compiler/simplCore/CSE.lhs
+++ b/
compiler/simplCore/CSE.lhs
@@
-49,8
+49,8
@@
So we carry an extra var->var substitution which we apply *before* looking up in
reverse mapping.
reverse mapping.
-[Note: SHADOWING]
-~~~~~~~~~~~~~~~~~
+Note [Shadowing]
+~~~~~~~~~~~~~~~~
We have to be careful about shadowing.
For example, consider
f = \x -> let y = x+x in
We have to be careful about shadowing.
For example, consider
f = \x -> let y = x+x in
@@
-239,7
+239,7
@@
cseAlts :: CSEnv -> CoreExpr -> CoreBndr -> CoreBndr -> [CoreAlt] -> [CoreAlt]
cseAlts env scrut' bndr _bndr' [(DataAlt con, args, rhs)]
| isUnboxedTupleCon con
-- Unboxed tuples are special because the case binder isn't
cseAlts env scrut' bndr _bndr' [(DataAlt con, args, rhs)]
| isUnboxedTupleCon con
-- Unboxed tuples are special because the case binder isn't
- -- a real values. See Note [Unboxed tuple case binders]
+ -- a real value. See Note [Unboxed tuple case binders]
= [(DataAlt con, args'', tryForCSE new_env rhs)]
where
(env', args') = addBinders env args
= [(DataAlt con, args'', tryForCSE new_env rhs)]
where
(env', args') = addBinders env args
@@
-347,7
+347,7
@@
addBinder (CS cs in_scope sub) v
(CS emptyUFM in_scope sub, v)
-- This last case is the unusual situation where we have shadowing of
-- a type variable; we have to discard the CSE mapping
(CS emptyUFM in_scope sub, v)
-- This last case is the unusual situation where we have shadowing of
-- a type variable; we have to discard the CSE mapping
- -- See "IMPORTANT NOTE" at the top
+ -- See Note [Shadowing]
where
v' = uniqAway in_scope v
where
v' = uniqAway in_scope v