summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-11-04 09:08:18 +0000
committerSimon Marlow <marlowsd@gmail.com>2011-11-04 13:09:52 +0000
commit32feee45a384fcaad4093c71dea64d23000541e6 (patch)
tree11d6f61edf9551f8c98de80900ec730d00c16dbd
parent76bce1b7f5f501626fbaf056e2dd23c6daaed33f (diff)
downloadhaskell-32feee45a384fcaad4093c71dea64d23000541e6.tar.gz
drop SCC on a variable when it has a non-function type
-rw-r--r--compiler/coreSyn/CoreUtils.lhs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/coreSyn/CoreUtils.lhs b/compiler/coreSyn/CoreUtils.lhs
index 601165e0f3..6bcf3fbde4 100644
--- a/compiler/coreSyn/CoreUtils.lhs
+++ b/compiler/coreSyn/CoreUtils.lhs
@@ -211,6 +211,15 @@ mkCoerce co expr
-- annotation if possible.
mkTick :: Tickish Id -> CoreExpr -> CoreExpr
+mkTick t (Var x)
+ | isFunTy (idType x) = Tick t (Var x)
+ | otherwise
+ = if tickishCounts t
+ then if tickishScoped t && tickishCanSplit t
+ then Tick (mkNoScope t) (Var x)
+ else Tick t (Var x)
+ else Var x
+
mkTick t (Cast e co)
= Cast (mkTick t e) co -- Move tick inside cast