Establish the CoreSyn let/app invariant
authorsimonpj@microsoft.com <unknown>
Mon, 5 Feb 2007 17:31:50 +0000 (17:31 +0000)
committersimonpj@microsoft.com <unknown>
Mon, 5 Feb 2007 17:31:50 +0000 (17:31 +0000)
commit7b01315da1b2fab02d3778bedec3ae8c57a1bc42
tree8d7a8be4759b38b4b6925bea6ba5b75245b00841
parent77241a03e4c0c56b35c63a303b96933232ecd083
Establish the CoreSyn let/app invariant

This patch clears up a long-standing wart.   For some time it's been the
case that
the RHS of a non-recursive let can be unlifed iff
the RHS is ok-for-speculation

This patch extends the invariant to the argument of an App, and
establishes it by the smart constructors mkDsApp, mkDsApps in the desugarer.

Once established, it should be maintained by the optimiser.

This tides up some awkward cases, notably in exprIsHNF, and I think it
fixes a outright strictness bug in Simplify.prepareRhs.
compiler/coreSyn/CoreSyn.lhs
compiler/coreSyn/CoreUtils.lhs
compiler/deSugar/DsExpr.lhs
compiler/deSugar/DsUtils.lhs