summaryrefslogtreecommitdiff
path: root/compiler/simplCore/Simplify.hs
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-03-19 11:53:01 -0400
committerBen Gamari <ben@smart-cactus.org>2018-02-04 00:02:33 -0500
commit260f547fda14842b8891f365e3dba3ba234b6edc (patch)
tree70eeab91a05e9f4d97a54821452f2da9ddda4cac /compiler/simplCore/Simplify.hs
parent1b442ed42b875cfc0b75ff0e8e431e671be071f8 (diff)
downloadhaskell-wip/libdw-prof.tar.gz
Never tick primitive string literalswip/libdw-prof
This is a more aggressive approach to the problem initially solved in f5b275a239d2554c4da0b7621211642bf3b10650, where top-level primitive string literals were being wrapped by ticks. This breaks the Core invariant descirbed in Note [CoreSyn top-level string literals]. However, the previous approach was incomplete and left several places where inappropriate ticks could sneak in. This commit kills the problem at the source: we simply never tick any primitive string literal expression. The assumption here is that these expressions are destined for the top-level, where they cannot be ticked, anyways. So even if they haven't been floated out yet there is no reason to tick them. This partially reverts commit f5b275a239d2554c4da0b7621211642bf3b10650. Test Plan: Validate with `-g` Reviewers: austin, scpmw, simonpj, simonmar, dfeuer Subscribers: dfeuer, simonmar, thomie Differential Revision: https://phabricator.haskell.org/D3063
Diffstat (limited to 'compiler/simplCore/Simplify.hs')
-rw-r--r--compiler/simplCore/Simplify.hs8
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs
index b123055387..ed2c9afa6c 100644
--- a/compiler/simplCore/Simplify.hs
+++ b/compiler/simplCore/Simplify.hs
@@ -438,15 +438,11 @@ prepareRhs mode top_lvl occ _ rhs0
-- On the other hand, for scoping ticks we need to be able to
-- copy them on the floats, which in turn is only allowed if
-- we can obtain non-counting ticks.
- | (not (tickishCounts t) || tickishCanSplit t)
+ | not (tickishCounts t) || tickishCanSplit t
= do { (is_exp, floats, rhs') <- go n_val_args rhs
- ; let tickIt (id, expr)
-- we have to take care not to tick top-level literal
-- strings. See Note [CoreSyn top-level string literals].
- | isTopLevel top_lvl && exprIsLiteralString expr
- = (id, expr)
- | otherwise
- = (id, mkTick (mkNoCount t) expr)
+ ; let tickIt (id, expr) = (id, mkTick (mkNoCount t) expr)
floats' = mapLetFloats floats tickIt
; return (is_exp, floats', Tick t rhs') }