Simon Peyton Jones pushed to branch wip/T27737 at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Core/Opt/Simplify/Iteration.hs
    ... ... @@ -1311,21 +1311,24 @@ simplExprF1 env (Let (NonRec bndr rhs) body) cont
    1311 1311
              tick (PreInlineUnconditionally bndr)
    
    1312 1312
            ; simplExprF env' body cont }
    
    1313 1313
     
    
    1314
    +simplExprF1 env expr@(Let {}) cont
    
    1315
    +  | not (seCaseCase env)
    
    1316
    +  , (inner, outer) <- splitContArgs cont
    
    1317
    +  , not (contIsStop outer)
    
    1318
    +  = do { expr' <- simplExprC env expr inner
    
    1319
    +       ; rebuild env expr' outer }
    
    1320
    +
    
    1314 1321
     -- Now check for a join point.  It's better to do the preInlineUnconditionally
    
    1315 1322
     -- test first, because joinPointBinding_maybe has to eta-expand, so a trivial
    
    1316 1323
     -- binding like { j = j2 |> co } would first be eta-expanded and then inlined
    
    1317 1324
     -- Better to test preInlineUnconditionally first.
    
    1325
    +--
    
    1326
    +-- Must be after the seCaseCase stuff:  todo: explain why
    
    1327
    +--   Example GHC.Internal.Debug
    
    1318 1328
     simplExprF1 env (Let bind body) cont
    
    1319 1329
       | Just bind' <- joinPointBind_maybe bind
    
    1320 1330
       = simplJoinPointBind env bind' body cont
    
    1321 1331
     
    
    1322
    -simplExprF1 env expr@(Let {}) cont
    
    1323
    -  | not (seCaseCase env)
    
    1324
    -  , (inner, outer) <- splitContArgs cont
    
    1325
    -  , not (contIsStop outer)
    
    1326
    -  = do { expr' <- simplExprC env expr inner
    
    1327
    -       ; rebuild env expr' outer }
    
    1328
    -
    
    1329 1332
     -- Non-recursive let
    
    1330 1333
     simplExprF1 env (Let (NonRec bndr rhs) body) cont
    
    1331 1334
       = {-#SCC "simplNonRecE" #-}