loop fusion not working for Int32, Int64 as it does for Int ?
|Reported by:||j.waldmann||Owned by:|
|Operating System:||Linux||Architecture:||x86_64 (amd64)|
|Type of failure:||None/Unknown||Test Case:||perf/should_run/T7507|
|Related Tickets:||Differential Rev(s):|
here is some code that works for Int, but gives me Stack Overflow for arguments 18 .. 24, and Out of memory for 25. (Just change the type annotation in main.)
import Data.Int import System.Environment bitcount x = if x > 0 then let (d,m) = divMod x 2 in bitcount d + m else 0 main = do [ arg ] <- getArgs print $ sum $ map bitcount [ 0 :: Int64 .. 2^read arg - 1 ]
Not sure whether it's a bug, but it's annoying. There is no conceptual difference between these numerical types, so I shouldn't have to rewrite my program when switching between them.