[GHC] #9645: Optimize range checks for primitive types