[commit: ghc] master: Careful tweaking to exprOkForSpeculation (f334d20)
git at git.haskell.org
git at git.haskell.org
Fri Dec 7 14:59:07 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/f334d20e00e3f4bd217e49216b7e9d9c8779db10/ghc
>---------------------------------------------------------------
commit f334d20e00e3f4bd217e49216b7e9d9c8779db10
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Dec 7 12:56:08 2018 +0000
Careful tweaking to exprOkForSpeculation
This patch does several things:
* Make exprOkForSpeculation ignore evaluatedness of variables
See the Note [exprOkForSpeculation and evaluated variables]
This means that the binder-swap transformation no longer
invaliates the let/app invariant.
* Make exprOkForSpeculation return False for
DataToTagOp and SeqOp.
See Note [exprOkForSpeculation and SeqOp/DataToTagOp]
* Remove the 'can_fail' property from dataToTag#; it was
always a hack (described in the old Note [dataToTag#] in
primops.txt.pp), and now its not necessary because of the
fixes above.
* Make SetLevels use exprIsHNF, /not/ exprOkForSpeculation,
when floating single-alternative cases. See SetLevels
Note [Floating single-alternative cases]
* Fix a buglet in FloatIn; probably never bites in practice
See Note [Dead bindings]
Collectively, these changes finally fix Trac #15696.
>---------------------------------------------------------------
f334d20e00e3f4bd217e49216b7e9d9c8779db10
compiler/coreSyn/CoreUtils.hs | 125 ++++++++++++++++++++++++++--------------
compiler/coreSyn/MkCore.hs | 2 +-
compiler/prelude/PrelRules.hs | 33 ++++++++++-
compiler/prelude/primops.txt.pp | 55 +-----------------
compiler/simplCore/FloatIn.hs | 13 ++++-
compiler/simplCore/SetLevels.hs | 32 +++++++---
6 files changed, 149 insertions(+), 111 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f334d20e00e3f4bd217e49216b7e9d9c8779db10
More information about the ghc-commits
mailing list