This roughly halves memory usage when compiling
module Foo where
foo :: Double -> Int
foo x | x == 1 = 1
...
foo x | x == 500 = 500
without optimisation.
module Bitmap (
Bitmap, mkBitmap,
intsToBitmap, intsToReverseBitmap,
module Bitmap (
Bitmap, mkBitmap,
intsToBitmap, intsToReverseBitmap,
+ mAX_SMALL_BITMAP_SIZE,
+ seqBitmap,
) where
#include "HsVersions.h"
) where
#include "HsVersions.h"
import SMRep
import Constants
import SMRep
import Constants
mAX_SMALL_BITMAP_SIZE | wORD_SIZE == 4 = 27
| otherwise = 58
mAX_SMALL_BITMAP_SIZE | wORD_SIZE == 4 = 27
| otherwise = 58
+seqBitmap :: Bitmap -> a -> a
+seqBitmap = seqList
+
import VarSet
import VarEnv
import Maybes ( orElse, expectJust )
import VarSet
import VarEnv
import Maybes ( orElse, expectJust )
-import Bitmap ( intsToBitmap )
#ifdef DEBUG
import Outputable
#ifdef DEBUG
import Outputable
constructSRT :: IdEnv Int -> SRT -> SRT
constructSRT table (SRTEntries entries)
| isEmptyVarSet entries = NoSRT
constructSRT :: IdEnv Int -> SRT -> SRT
constructSRT table (SRTEntries entries)
| isEmptyVarSet entries = NoSRT
- | otherwise = SRT offset len bitmap
+ | otherwise = seqBitmap bitmap $ SRT offset len bitmap
where
ints = map (expectJust "constructSRT" . lookupVarEnv table)
(varSetElems entries)
where
ints = map (expectJust "constructSRT" . lookupVarEnv table)
(varSetElems entries)