summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2006-09-06 11:52:42 +0000
committersimonpj@microsoft.com <unknown>2006-09-06 11:52:42 +0000
commit061d33c9923500d169570171947335053b63755f (patch)
tree4391f19349aa0af4c52a688388ef56ddbc29b8ee /compiler
parentc949e1a9af96cd5241d8cfc74fe3c622258edd7e (diff)
downloadhaskell-061d33c9923500d169570171947335053b63755f.tar.gz
Make record selection look cheap
exprIsCheap was already making record selection look cheap, esp for dictionary selection; e.g. (==) dEq The idea is to allow those record selections to migrate inside a lambda, because on the whole it's more expensive to share than repeat them. But sometimes dictionary selection is nested; e.g. (==) ($p1Num dNum) This turned out to make a (fragile) rewrite rule fire a little more robustly, but it seems like a good idea in any case. This patch makes nested record selections also look cheap.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/coreSyn/CoreUtils.lhs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/coreSyn/CoreUtils.lhs b/compiler/coreSyn/CoreUtils.lhs
index 69f78fad8f..c59c751acf 100644
--- a/compiler/coreSyn/CoreUtils.lhs
+++ b/compiler/coreSyn/CoreUtils.lhs
@@ -476,7 +476,7 @@ exprIsCheap other_expr -- Applications and variables
-- to bother to check the number of args
--------------
- go_sel [arg] = exprIsTrivial arg -- I'm experimenting with making record selection
+ go_sel [arg] = exprIsCheap arg -- I'm experimenting with making record selection
go_sel other = False -- look cheap, so we will substitute it inside a
-- lambda. Particularly for dictionary field selection.
-- BUT: Take care with (sel d x)! The (sel d) might be cheap, but