diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-11-04 09:08:18 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-11-04 13:09:52 +0000 |
commit | 32feee45a384fcaad4093c71dea64d23000541e6 (patch) | |
tree | 11d6f61edf9551f8c98de80900ec730d00c16dbd | |
parent | 76bce1b7f5f501626fbaf056e2dd23c6daaed33f (diff) | |
download | haskell-32feee45a384fcaad4093c71dea64d23000541e6.tar.gz |
drop SCC on a variable when it has a non-function type
-rw-r--r-- | compiler/coreSyn/CoreUtils.lhs | 9 |
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 |