PrelRules: Don't break let/app invariant in shiftRule

Authored by bgamari on Jun 10 2019, 8:25 AM.

Description

PrelRules: Don't break let/app invariant in shiftRule

Previously shiftRule would rewrite as invalid shift like

let x = I# (uncheckedIShiftL# n 80)
in ...

to

let x = I# (error "invalid shift")
in ...

However, this breaks the let/app invariant as error is not
okay-for-speculation. There isn't an easy way to avoid this so let's not
try. Instead we just take advantage of the undefined nature of invalid
shifts and return zero.

Fixes Trac #16742.

Details

Committed
Marge Bot <ben+marge-bot@smart-cactus.org>Jun 14 2019, 9:48 AM
Parents
rGHCeffdd9480569: Implement the -XUnliftedNewtypes extension.
Branches
Unknown
Tags
Unknown
Marge Bot <ben+marge-bot@smart-cactus.org> committed rGHC5279dda861f6: PrelRules: Don't break let/app invariant in shiftRule (authored by bgamari).Jun 14 2019, 9:48 AM