summaryrefslogtreecommitdiff
path: root/compiler/specialise/Rules.lhs
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2007-02-02 17:35:27 +0000
committersimonpj@microsoft.com <unknown>2007-02-02 17:35:27 +0000
commitbea2ece06bbeab1d8abbde420b2fff383edd34be (patch)
treefc4b4eca5b58eb39545f2bec9b0d90d68ab9f02c /compiler/specialise/Rules.lhs
parentdd06e44c0dbb08ee1d8591530471db09802d4f78 (diff)
downloadhaskell-bea2ece06bbeab1d8abbde420b2fff383edd34be.tar.gz
Look through Notes when generating and matching RULES
Diffstat (limited to 'compiler/specialise/Rules.lhs')
-rw-r--r--compiler/specialise/Rules.lhs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/specialise/Rules.lhs b/compiler/specialise/Rules.lhs
index 35b44ab98c..b3c9791e41 100644
--- a/compiler/specialise/Rules.lhs
+++ b/compiler/specialise/Rules.lhs
@@ -423,6 +423,16 @@ match menv subst (Var v1) e2
| Just subst <- match_var menv subst v1 e2
= Just subst
+match menv subst e1 (Note n e2)
+ = match menv subst e1 e2
+ -- Note [Notes in RULE matching]
+ -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ -- Look through Notes. In particular, we don't want to
+ -- be confused by InlineMe notes. Maybe we should be more
+ -- careful about profiling notes, but for now I'm just
+ -- riding roughshod over them.
+ --- See Note [Notes in call patterns] in SpecConstr
+
-- Here is another important rule: if the term being matched is a
-- variable, we expand it so long as its unfolding is a WHNF
-- (Its occurrence information is not necessarily up to date,