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.

(cherry picked from commit 0bd3b9dd0428855b6f72f757c1214b5253aa7753)

Details

Committed
bgamariJun 15 2019, 2:39 PM
Parents
rGHC4b40bad6182c: users-guide: More release notes
Branches
Unknown
Tags
Unknown
References
wip/backport-T16742