Careful tweaking to exprOkForSpeculation

Authored by simonpj on Dec 7 2018, 6:56 AM.

Description

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 Trac #15696.

Details

Committed
simonpjDec 7 2018, 8:58 AM
Parents
rGHC5b7ca03995c1: Wibble to Taming the Kind Inference Monster
Branches
Unknown
Tags
Unknown