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

Commits:

4 changed files:

Changes:

  • compiler/GHC/Core/Opt/OccurAnal.hs
    ... ... @@ -1049,9 +1049,9 @@ occAnalBind !env lvl ire (NonRec bndr rhs) thing_inside combine
    1049 1049
         in
    
    1050 1050
         if isDeadOcc occ     -- Drop dead code; see Note [Dead code]
    
    1051 1051
         then WUD body_uds body
    
    1052
    -    else pprTrace "occAnal-nonrec" (vcat [ ppr bndr <+> ppr occ
    
    1053
    -                                         , text "rhs_uds" <+> ppr rhs_uds
    
    1054
    -                                         , text "body_uds" <+> ppr body_uds ]) $
    
    1052
    +    else -- pprTrace "occAnal-nonrec-join" (vcat [ ppr bndr <+> ppr occ
    
    1053
    +         --                                , text "rhs_uds" <+> ppr rhs_uds
    
    1054
    +         --                                , text "body_uds" <+> ppr body_uds ]) $
    
    1055 1055
              WUD (combineJoinPointUDs env rhs_uds body_uds)    -- Note `orUDs`
    
    1056 1056
                  (combine [NonRec (fst (tagNonRecBinder lvl occ bndr')) rhs']
    
    1057 1057
                           body)
    
    ... ... @@ -1069,7 +1069,10 @@ occAnalBind !env lvl ire (NonRec bndr rhs) thing_inside combine
    1069 1069
             (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr
    
    1070 1070
     
    
    1071 1071
             !(rhs_uds, final_bndr, rhs') = occAnalNonRecRhs env lvl ire mb_join tagged_bndr rhs
    
    1072
    -    in WUD (rhs_uds `andUDs` body_uds)      -- Note `andUDs`
    
    1072
    +    in -- pprTrace "occAnal-nonrec-nonjoin" (vcat [ ppr bndr <+> ppr occ
    
    1073
    +       --                                  , text "rhs_uds" <+> ppr rhs_uds
    
    1074
    +       --                                  , text "body_uds" <+> ppr body_uds ]) $
    
    1075
    +       WUD (rhs_uds `andUDs` body_uds)      -- Note `andUDs`
    
    1073 1076
                (combine [NonRec final_bndr rhs'] body)
    
    1074 1077
     
    
    1075 1078
     -----------------
    
    ... ... @@ -2397,7 +2400,7 @@ preinlineUnconditionally here!
    2397 2400
     
    
    2398 2401
     The INLINE pragma says "inline exactly this RHS"; perhaps the
    
    2399 2402
     programmer wants to expose that 'not', say. If we inline f that will make
    
    2400
    -the Stable unfoldign big, and that wasn't what the programmer wanted.
    
    2403
    +the Stable unfolding big, and that wasn't what the programmer wanted.
    
    2401 2404
     
    
    2402 2405
     Another way to think about it: if we inlined g as-is into multiple
    
    2403 2406
     call sites, now there's be multiple calls to f.
    
    ... ... @@ -3734,10 +3737,13 @@ data UsageDetails
    3734 3737
     
    
    3735 3738
     instance Outputable UsageDetails where
    
    3736 3739
       ppr ud@(UD { ud_env = env, ud_z_tail = z_tail })
    
    3737
    -    = text "UD" <+> (braces $ fsep $ punctuate comma $
    
    3738
    -      [ ppr uq <+> text ":->" <+> ppr (lookupOccInfoByUnique ud uq)
    
    3739
    -      | (uq, _) <- nonDetStrictFoldVarEnv_Directly do_one [] env ])
    
    3740
    -      $$ nest 2 (text "ud_z_tail" <+> ppr z_tail)
    
    3740
    +    = text "UD" <> (braces (vcat
    
    3741
    +         [ -- `final` shows the result of a proper lookupOccInfo, returning OccInfo
    
    3742
    +           --         after accounting for `ud_z_tail` etc.
    
    3743
    +           text "final =" <+> (fsep $ punctuate comma $
    
    3744
    +                 [ ppr uq <+> text ":->" <+> ppr (lookupOccInfoByUnique ud uq)
    
    3745
    +                 | (uq, _) <- nonDetStrictFoldVarEnv_Directly do_one [] env ])
    
    3746
    +         , text "ud_z_tail" <+> ppr z_tail ] ))
    
    3741 3747
         where
    
    3742 3748
           do_one :: Unique -> LocalOcc -> [(Unique,LocalOcc)] -> [(Unique,LocalOcc)]
    
    3743 3749
           do_one uniq occ occs = (uniq, occ) : occs
    

  • compiler/GHC/Types/Basic.hs
    ... ... @@ -1333,7 +1333,7 @@ zapFragileOcc occ = zapOccTailCallInfo occ
    1333 1333
     
    
    1334 1334
     instance Outputable OccInfo where
    
    1335 1335
       -- only used for debugging; never parsed.  KSW 1999-07
    
    1336
    -  ppr (ManyOccs tails)     = pprShortTailCallInfo tails
    
    1336
    +  ppr (ManyOccs tails)     = text "Many" <> parens (pprShortTailCallInfo tails)
    
    1337 1337
       ppr IAmDead              = text "Dead"
    
    1338 1338
       ppr (IAmALoopBreaker rule_only tails)
    
    1339 1339
             = text "LoopBreaker" <> pp_ro <> pprShortTailCallInfo tails
    

  • libraries/os-string
    1
    -Subproject commit c08666bf7bf528e607fc1eacc20032ec59e69df3
    1
    +Subproject commit 2e693aad07540173a0169971b27c9acac28eeff1

  • libraries/unix
    1
    -Subproject commit 60f432b76871bd7787df07dd3e2a567caba393f5
    1
    +Subproject commit c9b3e95b5c15b118e55522bd92963038c6a88160