summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorReid Barton <rwbarton@gmail.com>2017-02-27 17:13:24 -0500
committerBen Gamari <ben@smart-cactus.org>2017-02-28 10:56:06 -0500
commitd0508ef001e9c93920f6eb066cab5e79041cb886 (patch)
tree0b9978dbe8489d07ac127c3e9efd6ac82f98b2f4 /mk
parent5dc28ba5886cd64a864dbda5aa6989bb91838866 (diff)
downloadhaskell-d0508ef001e9c93920f6eb066cab5e79041cb886.tar.gz
When floating, don't box an expression that's okay for speculation (#13338)
Commit 432f952e (Float unboxed expressions by boxing) lets the float-out pass turn, for example, ... (-# (remInt# x# 100000#) i#) ... into let lvl :: Int lvl = case remInt# x# 100000# of v { __DEFAULT__ -> I# v } in ... (-# (case lvl of { I# v -> v }) i#) ... But when, as in the example above, the expression that was floated out was the argument of an application, the resulting application may no longer satisfy the let/app invariant, because exprOkForSpeculation doesn't look far enough inside the definition of lvl. Solution: When the expression we floated out was okay for speculation, don't bother boxing it. It will be evaluated earlier, and that's okay by assumption. Fixes the let/app invariant and is cheaper too. Test Plan: make slowtest TEST=T13338 Reviewers: austin, bgamari, simonpj Reviewed By: bgamari, simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3217
Diffstat (limited to 'mk')
0 files changed, 0 insertions, 0 deletions