• andy@galois.com's avatar
    Turning off case liberation when using the hpc option, for now · d363c1fc
    andy@galois.com authored
    Consider the following code
         f = g (case v of
                  V a b -> a : t f)
    where g is expensive. Liberate case will turn this into
         f = g (case v of
                 V a b -> a : t (letrec f = g (case v of
                                               V a b -> a : f t)
                                  in f)
    Yikes! We evaluate g twice. This leads to a O(2^n) explosion
    if g calls back to the same code recursively.
    This happen sometimes in HPC, because every tick is a liberate-able case,
    but is a general problem to case liberation (I think). 
DynFlags.hs 48.1 KB