• Simon Peyton Jones's avatar
    Set strictness correctly for JoinIds · ce6ce788
    Simon Peyton Jones authored
    We were failing to keep correct strictness info when eta-expanding
    join points; Trac #15517.   The situation was something like
    
      \q v eta ->
         let j x = error "blah
             -- STR Lx   bottoming!
         in case y of
               A -> j x eta
               B -> blah
               C -> j x eta
    
    So we spot j as a join point and eta-expand it.  But we must
    also adjust the stricness info, else it vlaimes to bottom after
    one arg is applied but now it has become two.
    
    I fixed this in two places:
    
     - In CoreOpt.joinPointBinding_maybe, adjust strictness info
    
     - In SimplUtils.tryEtaExpandRhs, return consistent values
       for arity and bottom-ness
    ce6ce788
Demand.hs 79.4 KB