| ... |
... |
@@ -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
|