Don't tick top-level string literals

Authored by bgamari on Feb 1 2017, 9:48 PM.


Don't tick top-level string literals

This fixes a regression due to D2605 (see Trac #8472) wherein top-level primitive
strings would fail to be noticed by CoreToStg as they were wrapped in a
tick. This resulted in a panic in CoreToStg due to inconsistent CAF information
(or a Core Lint failure, if enabled). Here we document the invariant that
unlifted expressions can only sit at top-level if of the form `Lit (MachStr
...)` with no ticks or other embellishments. Moreover, we fix instance of
this in Simplify.prepareRhs and FloatOut.wrapTick where this
invariant was being broken.

Test Plan: Validate with -g. Run testsuite with WAY=ghci.

Reviewers: austin, simonpj

Reviewed By: simonpj

Subscribers: simonpj, akio, scpmw, thomie

Differential Revision: