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

Commits:

9 changed files:

Changes:

  • compiler/GHC/Core/Opt/Simplify/Inline.hs
    ... ... @@ -385,7 +385,7 @@ tryUnfolding env logger id lone_variable arg_infos
    385 385
                -- be *something* interesting about some argument, or the
    
    386 386
                -- result context, to make it worth inlining
    
    387 387
         calc_some_benefit :: Arity -> Bool -> Bool   -- The Arity is the number of args
    
    388
    -                                         -- expected by the unfolding
    
    388
    +                                                 -- expected by the unfolding
    
    389 389
         calc_some_benefit uf_arity is_inline
    
    390 390
            | not saturated = interesting_args       -- Under-saturated
    
    391 391
                                             -- Note [Unsaturated applications]
    

  • compiler/GHC/Core/Opt/Simplify/Iteration.hs
    ... ... @@ -3557,7 +3557,8 @@ life" in one of two ways:
    3557 3557
     
    
    3558 3558
     Thus, when we are simply reconstructing a case (the common case), and the
    
    3559 3559
     case binder is not dead, or the scrutinee is a variable, we zap the
    
    3560
    -occurrence info on DataAlt field binders. See `adjustFieldOccInfo`.
    
    3560
    +occurrence info on DataAlt field binders. See `fieldOccInfoStable`
    
    3561
    +and `adjustFieldsIdInfo`.
    
    3561 3562
     
    
    3562 3563
     Note [Improving seq]
    
    3563 3564
     ~~~~~~~~~~~~~~~~~~~~
    
    ... ... @@ -3765,70 +3766,90 @@ do it here). The right thing is to do some kind of binder-swap;
    3765 3766
     see #15226 for discussion.
    
    3766 3767
     -}
    
    3767 3768
     
    
    3768
    -adjustFieldsIdInfo :: Maybe OutExpr -> OutId -> BinderSwapDecision -> DataCon -> [Id] -> [Id]
    
    3769
    +adjustFieldsIdInfo :: Maybe OutExpr -> OutId -> BinderSwapDecision
    
    3770
    +                   -> DataCon -> [InBndr] -> [InBndr]
    
    3769 3771
     -- See Note [Adding evaluatedness info to pattern-bound variables]
    
    3770 3772
     -- and Note [DataAlt occ info]
    
    3773
    +--
    
    3774
    +-- This can be a hot path in the compiler (e.g. T9233 which has a large strict record)
    
    3775
    +-- Hence
    
    3776
    +--   (a) we build the result list strictly: it is consumed in full right away,
    
    3777
    +--       so thunks for the elements or the spine are pure waste
    
    3778
    +--   (b) we update each field binder's IdInfo at most once
    
    3779
    +--   (c) we leave alone a field binder that is dead and will stay dead
    
    3780
    +--       (see `fieldOccInfoStable`); its evaluated-ness is irrelevant
    
    3771 3781
     adjustFieldsIdInfo scrut case_bndr bndr_swap con vs
    
    3782
    +
    
    3772 3783
       -- Deal with seq# applications
    
    3784
    +  -- See (SEQ3) in Note [seq# magic] in GHC.Types.Id.Make
    
    3785
    +  --   case (seq# a b) of (# _, x' #) ->  ....
    
    3786
    +  -- we can mark x' as evaluated
    
    3773 3787
       | Just scr <- scrut
    
    3774 3788
       , isUnboxedTupleDataCon con
    
    3775
    -  , [s,x] <- vs
    
    3776 3789
         -- Use stripNArgs rather than collectArgsTicks to avoid building
    
    3777 3790
         -- a list of arguments only to throw it away immediately.
    
    3778 3791
       , Just (Var f) <- stripNArgs 4 scr
    
    3779 3792
       , f `hasKey` seqHashKey
    
    3780
    -  , let x' = setCaseBndrEvald MarkedStrict x
    
    3781
    -  = map (adjustFieldOccInfo case_bndr bndr_swap) [s, x']
    
    3782
    -
    
    3783
    -  -- Deal with banged datacon fields
    
    3784
    -  -- This case is quite allocation sensitive to T9233 which has a large record
    
    3785
    -  -- with strict fields. Hence we try not to update vs twice!
    
    3786
    -adjustFieldsIdInfo _scrut case_bndr bndr_swap con vs
    
    3787
    -  | Nothing <- dataConWrapId_maybe con
    
    3788
    -      -- A common fast path; no need to allocate the_strs when they are all lazy
    
    3789
    -      -- anyway! It shaves off 2% in T9675
    
    3790
    -  = map (adjustFieldOccInfo case_bndr bndr_swap) vs
    
    3793
    +  = go vs [topDmd, evalDmd]   -- seq# returns an evaluated x
    
    3794
    +
    
    3795
    +  -- We could have a short-cut for when occ_stable is True (uncommon),
    
    3796
    +  -- and the data construtor has no bangs (common)
    
    3797
    +  -- General case
    
    3791 3798
       | otherwise
    
    3792 3799
       = go vs wkr_dmds
    
    3793 3800
       where
    
    3794 3801
         -- The demand signature of the worker has a strict demand for exactly the
    
    3795
    -    -- strict (banged) fields; one demand for each value argument, including
    
    3802
    +    -- strict (banged) fields; one demand for each value argument, /including/
    
    3796 3803
         -- existential CoVars.  See GHC.Types.Id.Make.mkDataConWorkId.
    
    3797
    -    -- NB: we do /not/ mark an unlifted field as evaluated: that gains nothing,
    
    3798
    -    -- and an OtherCon[] unfolding makes `interestingArg` say NonTrivArg,
    
    3799
    -    -- which changes inlining decisions (we saw this in compiler/perf/T19695).
    
    3804
    +    --
    
    3805
    +    -- An /unlifted/ field has a lazy demand, and hence won't be marked as
    
    3806
    +    -- evaluated: doing so gains nothing.  This doesn't matter much, if at all;
    
    3807
    +    -- in the past OtherCon[] have affected inlining decision, but not now
    
    3808
    +    -- since `interestingArg` says `TrivArg` for OtherCon[].
    
    3809
    +    -- (compiler/perf/T19695 is an example of this delicacy)
    
    3810
    +    --
    
    3811
    +    -- We could use `dataConRepArgCbvInfos`, but that has ArgCbv for unlifted
    
    3800 3812
         DmdSig (DmdType _ wkr_dmds) = idDmdSig (dataConWorkId con)
    
    3801
    -
    
    3802
    -    go [] [] = []
    
    3803
    -    go (v:vs') dmds | isTyVar v = v : go vs' dmds
    
    3804
    -    go (v:vs') (dmd:dmds) = adjustFieldOccInfo case_bndr bndr_swap (set_evald dmd v) : go vs' dmds
    
    3805
    -    go _ _ = pprPanic "Simplify.adjustFieldsIdInfo"
    
    3806
    -              (ppr con $$
    
    3807
    -               ppr vs  $$
    
    3808
    -               ppr_with_length wkr_dmds $$
    
    3809
    -               ppr_with_length (dataConRepArgTys con))
    
    3810
    -      where
    
    3811
    -        ppr_with_length list
    
    3812
    -          = ppr list <+> parens (text "length =" <+> ppr (length list))
    
    3813
    -
    
    3814
    -    set_evald dmd v | isStrDataConDmd dmd = setCaseBndrEvald MarkedStrict v
    
    3815
    -                    | otherwise           = v
    
    3816
    -
    
    3817
    -adjustFieldOccInfo :: OutId -> BinderSwapDecision -> CoreBndr -> CoreBndr
    
    3818
    --- Kill occ info if we do binder swap and the case binder is alive;
    
    3819
    --- see Note [DataAlt occ info]
    
    3820
    -adjustFieldOccInfo case_bndr bndr_swap field_bndr
    
    3821
    -  | isTyVar field_bndr
    
    3822
    -  = field_bndr
    
    3823
    -
    
    3824
    -  | not (isDeadBinder case_bndr)  -- (1) in the Note: If the case binder is alive,
    
    3825
    -  = zapIdOccInfo field_bndr       -- the field binders might come back alive
    
    3826
    -
    
    3827
    -  | DoBinderSwap{} <- bndr_swap   -- (2) in the Note: If binder swap might take place,
    
    3828
    -  = zapIdOccInfo field_bndr       -- the case binder might come back alive
    
    3829
    -
    
    3830
    -  | otherwise
    
    3831
    -  = field_bndr                    -- otherwise the field binders stay dead
    
    3813
    +    occ_stable = fieldOccInfoStable case_bndr bndr_swap
    
    3814
    +
    
    3815
    +    go :: [Var] -> [Demand] -> [Var]
    
    3816
    +    -- This loop works strictly because the result is always consumed strictly
    
    3817
    +    go (v:vs') dmds
    
    3818
    +      | isTyVar v       = let !vs'' = go vs' dmds in v : vs''
    
    3819
    +      | (d:ds') <- dmds = let !v'   = adjust d v
    
    3820
    +                              !vs'' = go vs' ds'
    
    3821
    +                          in v' : vs''
    
    3822
    +    go []  [] = []
    
    3823
    +    go vs' ds = pprPanic "Simplify.adjustFieldsIdInfo" (ppr con $$ ppr vs $$ ppr vs' $$ ppr ds)
    
    3824
    +
    
    3825
    +    -- Set evaluated-ness (if dmd is strict) and zap occ-info
    
    3826
    +    -- (if not occ_stable), with at most one IdInfo update
    
    3827
    +    adjust :: Demand -> Id -> Id
    
    3828
    +    adjust dmd v
    
    3829
    +      = case isStrDataConDmd dmd of
    
    3830
    +          True  | occ_stable -> if isDeadBinder v then nop v else set_evald v
    
    3831
    +                | otherwise  -> set_evald_zap_occ v
    
    3832
    +          False | occ_stable -> nop v
    
    3833
    +                | otherwise  -> zap_occ v
    
    3834
    +
    
    3835
    +    -- The four different possibilities; each modifies the IdInfo once
    
    3836
    +    nop               v = v
    
    3837
    +    set_evald         v = v `setIdUnfolding` evaldUnfolding
    
    3838
    +    zap_occ           v = zapIdOccInfo v
    
    3839
    +    set_evald_zap_occ v = modifyIdInfo (\info -> info `setUnfoldingInfo` evaldUnfolding
    
    3840
    +                                                      `setOccInfo`       noOccInfo) v
    
    3841
    +
    
    3842
    +fieldOccInfoStable :: OutId -> BinderSwapDecision -> Bool
    
    3843
    +-- True <=> the occ-info on the field binders of a DataAlt remains valid;
    
    3844
    +-- in particular a dead field binder will stay dead.
    
    3845
    +-- False <=> we must zap the field binders' occ-info.
    
    3846
    +-- See Note [DataAlt occ info]
    
    3847
    +fieldOccInfoStable case_bndr bndr_swap
    
    3848
    +  | not (isDeadBinder case_bndr) = False  -- (1) in the Note: If the case binder is alive,
    
    3849
    +                                          -- the field binders might come back alive
    
    3850
    +  | DoBinderSwap{} <- bndr_swap  = False  -- (2) in the Note: If binder swap might take place,
    
    3851
    +                                          -- the case binder might come back alive
    
    3852
    +  | otherwise                    = True   -- Otherwise the field binders stay dead
    
    3832 3853
     
    
    3833 3854
     addDefaultUnfoldings :: SimplEnv -> OutId -> BinderSwapDecision -> [AltCon] -> SimplEnv
    
    3834 3855
     addDefaultUnfoldings env case_bndr bndr_swap imposs_deflt_cons
    

  • compiler/GHC/Core/Opt/Simplify/Utils.hs
    ... ... @@ -1123,7 +1123,7 @@ interestingCallContext env cont
    1123 1123
             -- in GHC.Core.Unfold
    
    1124 1124
     
    
    1125 1125
         interesting (StrictArg { sc_fun = fun }) = strictArgContext fun
    
    1126
    -    interesting (StrictBind {})              = BoringCtxt
    
    1126
    +    interesting (StrictBind {})              = RhsCtxt NonRecursive
    
    1127 1127
         interesting (Stop _ cci _)               = cci
    
    1128 1128
         interesting (TickIt _ k)                 = interesting k
    
    1129 1129
         interesting (ApplyToTy { sc_cont = k })  = interesting k
    
    ... ... @@ -1208,13 +1208,21 @@ Wrinkles:
    1208 1208
     
    
    1209 1209
     (IA2) OtherCon.
    
    1210 1210
        interestingArg returns
    
    1211
    -      (a) NonTrivArg for an arg with an OtherCon [] unfolding
    
    1211
    +      (a) TrivArg for an arg with an OtherCon [] unfolding
    
    1212 1212
           (b) ValueArg for an arg with an OtherCon [c1,c2..] unfolding.
    
    1213 1213
     
    
    1214
    -   Reason for (a): I found (in the GHC.Internal.Bignum.Integer module) that I was
    
    1215
    -   inlining a pretty big function when all we knew was that its arguments
    
    1216
    -   were evaluated, nothing more.  That in turn make the enclosing function
    
    1217
    -   too big to inline elsewhere.
    
    1214
    +   Reason for (a): knowing only that an argument is evaluated, but not which
    
    1215
    +   constructor it is, rarely makes inlining worthwhile.  For example, in test
    
    1216
    +   T18140 we have
    
    1217
    +      data D = D !(Maybe Bool) ... !(Maybe Bool)
    
    1218
    +      maMB :: Maybe Bool -> Maybe Bool -> Maybe Bool
    
    1219
    +      maD (D x1 ... x18) (D y1 ... y18) = D (maMB x1 y1) ... (maMB x18 y18)
    
    1220
    +   The xi and yi come from strict fields, so they have OtherCon [] unfoldings.
    
    1221
    +   If that made them interesting we would inline maMB 18 times, to no benefit,
    
    1222
    +   just bloating maD.  (Similarly, in GHC.Internal.Bignum.Integer I found that
    
    1223
    +   I was inlining a pretty big function when all we knew was that its
    
    1224
    +   arguments were evaluated.  That in turn made the enclosing function too big
    
    1225
    +   to inline elsewhere.)
    
    1218 1226
     
    
    1219 1227
        But this choice is delicate.  Sometimes inlining a tiny function applied to
    
    1220 1228
        an evaluated argument /is/ very beneficial, because the /result/ is
    
    ... ... @@ -1255,6 +1263,25 @@ Wrinkles:
    1255 1263
        Conclusion: `interestingArg` should give some encouragement (NonTrivArg) to `f`
    
    1256 1264
        when the argument is expandable. Hence `uf_expandable` in the `Var` case.
    
    1257 1265
     
    
    1266
    +(IA5) We are keen to inline a higher-order function applied to lambda, e.g.
    
    1267
    +             f (\x. blah)
    
    1268
    +  where
    
    1269
    +    f h = ...(h xs)...
    
    1270
    +  Doing so specialises `f` to the particular argument which can make a
    
    1271
    +  big difference.  Note, however, that we don't want to be defeated if
    
    1272
    +  the lambda is let-bound:
    
    1273
    +      let h = (\x.blah)
    
    1274
    +      in ...f h...
    
    1275
    +  So we need to look through h's unfolding.
    
    1276
    +
    
    1277
    +  This makes parser combinators, which are usually applied to functions,
    
    1278
    +  rather keen to inline, so whether they do so is mostly decided by their
    
    1279
    +  size.  Test T17516 is a delicate example: if `max` on positions inlines
    
    1280
    +  into the combinators in T17516A, the combinators are too big to inline into
    
    1281
    +  the client module T17516; if not (because max's arguments are merely
    
    1282
    +  evaluated, see (IA2)), they are small and do inline, making T17516 itself
    
    1283
    +  slower to compile.  But inlining makes the code better too, with fewer
    
    1284
    +  unknown calls.
    
    1258 1285
     -}
    
    1259 1286
     
    
    1260 1287
     interestingArg :: SimplEnv -> StaticEnv -> CoreExpr -> ArgSummary
    
    ... ... @@ -1283,7 +1310,7 @@ interestingArg env se e
    1283 1310
         go env n (Lam v e)
    
    1284 1311
            | isTyVar v             = go env n e
    
    1285 1312
            | n>0                   = NonTrivArg     -- (\x.b) e   is NonTriv
    
    1286
    -       | otherwise             = ValueArg
    
    1313
    +       | otherwise             = ValueArg       -- (\x.b)     is Value: see (IA5)
    
    1287 1314
         go _ _ (Case {})           = NonTrivArg
    
    1288 1315
         go env n (Let b e)         = case go env' n e of
    
    1289 1316
                                        ValueArg -> ValueArg
    
    ... ... @@ -1293,17 +1320,16 @@ interestingArg env se e
    1293 1320
     
    
    1294 1321
         go_var n v
    
    1295 1322
            | isConLikeId v = ValueArg   -- Experimenting with 'conlike' rather that
    
    1296
    -                                    --    data constructors here
    
    1297
    -                                    -- DFuns are con-like;
    
    1323
    +                                    --    data constructors here (includes DFuns)
    
    1298 1324
                                         --    see (IA1) in Note [Interesting arguments]
    
    1299
    -       | idArity v > n = ValueArg   -- Catches (eg) primops with arity but no unfolding
    
    1325
    +       | idArity v > n = ValueArg   -- See (IA5) in Note [Interesting arguments]
    
    1300 1326
            | n > 0         = NonTrivArg -- Saturated or unknown call
    
    1301 1327
            | otherwise  -- n==0, no value arguments; look for an interesting unfolding
    
    1302 1328
            = case idUnfolding v of
    
    1303
    -           OtherCon [] -> NonTrivArg   -- It's evaluated, but that's all we know
    
    1329
    +           OtherCon [] -> TrivArg      -- It's evaluated, but that's all we know
    
    1304 1330
                OtherCon _  -> ValueArg     -- Evaluated and we know it isn't these constructors
    
    1305
    -              -- See (IA2) in Note [Interesting arguments]
    
    1306
    -           DFunUnfolding {} -> ValueArg   -- We konw that idArity=0
    
    1331
    +                                       -- See (IA2) in Note [Interesting arguments]
    
    1332
    +           DFunUnfolding {} -> ValueArg   -- We know that idArity=0
    
    1307 1333
                CoreUnfolding{ uf_cache = cache }
    
    1308 1334
                  | uf_is_conlike cache -> ValueArg    -- Includes constructor applications
    
    1309 1335
                  | uf_expandable cache -> NonTrivArg  -- See (IA4)
    

  • compiler/GHC/Types/Demand.hs
    ... ... @@ -1003,9 +1003,10 @@ isStrUsedDmd :: Demand -> Bool
    1003 1003
     isStrUsedDmd (n :* _) = isStrict n && not (isAbs n)
    
    1004 1004
     
    
    1005 1005
     -- | Is this demand, taken from the demand signature of a data constructor
    
    1006
    --- /worker/, the demand for a strict field?  The demands in a worker's
    
    1007
    --- signature are never absent (see GHC.Types.Id.Make.mkDataConWorkId), so
    
    1008
    --- unlike 'isStrUsedDmd' we don't need to check for absence.
    
    1006
    +-- /worker/, the demand for a strict field?  It would be more obviously correct
    
    1007
    +-- to use isStrUsedDmd, in case the dmd is Absent. But data constructor workers
    
    1008
    +-- never have absent arguments, and isStrictDmd is more efficient.
    
    1009
    +-- See GHC.Types.Id.Make.mkDataConWorkId.
    
    1009 1010
     isStrDataConDmd :: Demand -> Bool
    
    1010 1011
     isStrDataConDmd = isStrictDmd
    
    1011 1012
     
    
    ... ... @@ -1475,23 +1476,21 @@ arguments. That is the job of dmdTransformDataConSig. More precisely,
    1475 1476
      * it returns the demands on the arguments;
    
    1476 1477
        in the above example that is [SL, A]
    
    1477 1478
     
    
    1478
    -When the data constructor worker has strict fields, an additional seq
    
    1479
    -will be inserted for each field (see (SFC3) in Note [Strict fields in Core]).
    
    1480
    -Hence we add an additional `seqDmd` for each strict field to emulate
    
    1481
    -field eval insertion.  We find the strict fields from the demand signature
    
    1482
    -of the worker (built by GHC.Types.Id.Make.mkDataConWorkId), which has a
    
    1483
    -strict demand for exactly the strict fields (bangs).
    
    1484
    -
    
    1485
    -NB: we must /not/ add a `seqDmd` for a field that is lazy but has an unlifted
    
    1486
    -type: such an argument is evaluated before the call, not by the constructor,
    
    1487
    -and adding `seqDmd` would turn an absent field into a used one, defeating
    
    1488
    -absent-argument worker/wrapper (e.g. test T25177).
    
    1489
    -
    
    1490
    -For example, consider `data SP a b = MkSP !a !b` and expression `MkSP x y`,
    
    1491
    -with the same sub-demand P(SL,A).
    
    1492
    -The strict fields bump up the strictness; we'd get [SL,1!A] for the field
    
    1493
    -demands. Note that the first demand was unaffected by the seq, whereas
    
    1494
    -the second, previously absent demand became `seqDmd` exactly.
    
    1479
    +(DTC1) When the data constructor worker has strict fields, an additional seq will
    
    1480
    +  be inserted for each field (see (SFC3) in Note [Strict fields in Core]).  Hence
    
    1481
    +  we add an additional `seqDmd` for each strict field to emulate field eval
    
    1482
    +  insertion.  We find the strict fields from the demand signature of the worker
    
    1483
    +  (built by GHC.Types.Id.Make.mkDataConWorkId), which has a strict demand for
    
    1484
    +  exactly the strict fields (bangs).
    
    1485
    +
    
    1486
    +  For example, consider `data SP a b = MkSP !a !b` and expression `MkSP x y`, with
    
    1487
    +  the same sub-demand P(SL,A).  The strict fields bump up the strictness; we'd get
    
    1488
    +  [SL,1!A] for the field demands. Note that the first demand was unaffected by the
    
    1489
    +  seq, whereas the second, previously absent demand became `seqDmd` exactly.
    
    1490
    +
    
    1491
    +(DTC2) An additional `seq` will /not/ be inserted for an unlifted field, so we must
    
    1492
    +  correspondingly not add a `seqDmd` for them.  Adding `seqDmd` would turn an absent
    
    1493
    +  field into a used one, defeating absent-argument worker/wrapper (e.g. test T25177).
    
    1495 1494
     -}
    
    1496 1495
     
    
    1497 1496
     {- *********************************************************************
    
    ... ... @@ -2530,11 +2529,13 @@ dmdTransformDataConSig (DmdSig (DmdType _ sig_dmds)) sd
    2530 2529
         arity = length sig_dmds
    
    2531 2530
         (n, body_sd) = peelManyCalls arity sd
    
    2532 2531
         mk_body_ty n dmds = DmdType nopDmdEnv (zipWith (bump n) sig_dmds dmds)
    
    2532
    +
    
    2533
    +    -- See (DTC1) in Note [Demand transformer for data constructors]
    
    2534
    +    -- NB (DTC2): isStrDataConDmd is false for unlifted fields;
    
    2535
    +    --            it is true only for fields with strictness annotations.
    
    2533 2536
         bump n sig_dmd dmd
    
    2534
    -      | isStrDataConDmd sig_dmd = multDmd n (plusDmd str_field_dmd dmd)  -- A strict field
    
    2537
    +      | isStrDataConDmd sig_dmd = multDmd n (plusDmd seqDmd dmd)
    
    2535 2538
           | otherwise               = multDmd n dmd
    
    2536
    -    str_field_dmd = seqDmd -- See the bit about strict fields
    
    2537
    -                           -- in Note [Demand transformer for data constructors]
    
    2538 2539
     
    
    2539 2540
     -- | A special 'DmdTransformer' for dictionary selectors that feeds the demand
    
    2540 2541
     -- on the result into the indicated dictionary component (if saturated).
    

  • libraries/ghc-internal/src/GHC/Internal/IO.hs
    ... ... @@ -483,7 +483,7 @@ a `finally` sequel =
    483 483
     -- | The primitive used to implement 'GHC.IO.evaluate'.
    
    484 484
     -- Prefer to use 'GHC.IO.evaluate' whenever possible!
    
    485 485
     seq# :: forall a s. a -> State# s -> (# State# s, a #)
    
    486
    --- See Note [seq# magic] in GHC.Types.Id.Make
    
    486
    +-- See Note [seq# magic] in GHC.Builtin.WiredIn.Ids
    
    487 487
     {-# NOINLINE seq# #-}  -- seq# is inlined manually in CorePrep
    
    488 488
     seq# a s = let !a' = lazy a in (# s, a' #)
    
    489 489
     
    

  • testsuite/tests/simplCore/should_compile/T26548.hs
    1
    +module T26548 where
    
    2
    +
    
    3
    +newtype N a = MkN (Maybe a)
    
    4
    +data T = MkT !(N Int) !(N Bool)
    
    5
    +
    
    6
    +f x = case x of { MkT a b ->
    
    7
    +      case x of { MkT c d -> MkT a d  } }

  • testsuite/tests/simplCore/should_compile/T26548.stderr
    1
    +
    
    2
    +==================== Tidy Core ====================
    
    3
    +Result size of Tidy Core
    
    4
    +  = {terms: 3, types: 3, coercions: 0, joins: 0/0}
    
    5
    +
    
    6
    +-- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
    
    7
    +f :: T -> T
    
    8
    +[GblId,
    
    9
    + Arity=1,
    
    10
    + Str=<1!P(L,L)>,
    
    11
    + Cpr=1,
    
    12
    + Unf=Unf{Src=StableSystem, TopLvl=True,
    
    13
    +         Value=True, ConLike=True, WorkFree=True, Expandable=True,
    
    14
    +         Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)
    
    15
    +         Tmpl= \ (x [Occ=Once1] :: T) -> x}]
    
    16
    +f = \ (x :: T) -> x
    
    17
    +
    
    18
    +
    
    19
    +

  • testsuite/tests/simplCore/should_compile/T26615.stderr
    ... ... @@ -2,7 +2,7 @@
    2 2
     
    
    3 3
     ==================== Tidy Core ====================
    
    4 4
     Result size of Tidy Core
    
    5
    -  = {terms: 1,229, types: 1,163, coercions: 18, joins: 17/29}
    
    5
    +  = {terms: 1,220, types: 1,160, coercions: 18, joins: 17/29}
    
    6 6
     
    
    7 7
     -- RHS size: {terms: 6, types: 8, coercions: 0, joins: 0/0}
    
    8 8
     unArray :: forall a. Array a -> SmallArray# a
    
    ... ... @@ -107,7 +107,7 @@ T26615a.$tcLeaf
    107 107
           T26615a.$trModule
    
    108 108
           $tcLeaf2
    
    109 109
           0#
    
    110
    -      GHC.Internal.Types.krep$*->*->*
    
    110
    +      krepStarArrStarArr
    
    111 111
     
    
    112 112
     -- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
    
    113 113
     $krep7 :: [GHC.Internal.Types.KindRep]
    
    ... ... @@ -181,7 +181,7 @@ T26615a.$tcArray
    181 181
           T26615a.$trModule
    
    182 182
           $tcArray2
    
    183 183
           0#
    
    184
    -      GHC.Internal.Types.krep$*Arr*
    
    184
    +      krepStarArr
    
    185 185
     
    
    186 186
     -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
    
    187 187
     $krep12 :: GHC.Internal.Types.KindRep
    
    ... ... @@ -251,7 +251,7 @@ T26615a.$tcHashMap
    251 251
           T26615a.$trModule
    
    252 252
           $tcHashMap2
    
    253 253
           0#
    
    254
    -      GHC.Internal.Types.krep$*->*->*
    
    254
    +      krepStarArrStarArr
    
    255 255
     
    
    256 256
     -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
    
    257 257
     $krep16 :: GHC.Internal.Types.KindRep
    
    ... ... @@ -612,7 +612,7 @@ lvl1
    612 612
       = GHC.Internal.Control.Exception.Base.patError @LiftedRep @() lvl
    
    613 613
     
    
    614 614
     Rec {
    
    615
    --- RHS size: {terms: 136, types: 130, coercions: 0, joins: 1/2}
    
    615
    +-- RHS size: {terms: 133, types: 129, coercions: 0, joins: 1/2}
    
    616 616
     T26615a.disjointSubtrees_$s$wdisjointSubtrees [InlPrag=INLINABLE[2],
    
    617 617
                                                    Occ=LoopBreaker]
    
    618 618
       :: forall k a b.
    
    ... ... @@ -635,7 +635,6 @@ T26615a.disjointSubtrees_$s$wdisjointSubtrees
    635 635
             Empty -> GHC.Internal.Types.True;
    
    636 636
             Leaf bx ds ->
    
    637 637
               case ds of { L kB ds1 ->
    
    638
    -          case kB of k0 { __DEFAULT ->
    
    639 638
               case eqWord# bx sc2 of {
    
    640 639
                 __DEFAULT -> GHC.Internal.Types.True;
    
    641 640
                 1# ->
    
    ... ... @@ -668,8 +667,7 @@ T26615a.disjointSubtrees_$s$wdisjointSubtrees
    668 667
                         }
    
    669 668
                         }; } in
    
    670 669
                   jump $wlookupInArrayCont_
    
    671
    -                sc k0 sc3 0# (sizeofSmallArray# @Lifted @(Leaf k a) sc3)
    
    672
    -          }
    
    670
    +                sc kB sc3 0# (sizeofSmallArray# @Lifted @(Leaf k a) sc3)
    
    673 671
               }
    
    674 672
               };
    
    675 673
             Collision bx bx1 ->
    
    ... ... @@ -710,7 +708,7 @@ T26615a.disjointSubtrees_$s$wdisjointSubtrees
    710 708
     end Rec }
    
    711 709
     
    
    712 710
     Rec {
    
    713
    --- RHS size: {terms: 719, types: 748, coercions: 18, joins: 13/23}
    
    711
    +-- RHS size: {terms: 713, types: 746, coercions: 18, joins: 13/23}
    
    714 712
     T26615a.$wdisjointSubtrees [InlPrag=INLINABLE[2], Occ=LoopBreaker]
    
    715 713
       :: forall k a b. Eq k => Int# -> HashMap k a -> HashMap k b -> Bool
    
    716 714
     [GblId[StrictWorker([~, ~, !])],
    
    ... ... @@ -740,7 +738,6 @@ T26615a.$wdisjointSubtrees [InlPrag=INLINABLE[2], Occ=LoopBreaker]
    740 738
                              Empty -> GHC.Internal.Types.True;
    
    741 739
                              Leaf bx [Occ=Once1] ds2 [Occ=Once1!] ->
    
    742 740
                                case ds2 of { L kB [Occ=Once1] _ [Occ=Dead] ->
    
    743
    -                           case kB of k0 [Occ=Once1] { __DEFAULT ->
    
    744 741
                                joinrec {
    
    745 742
                                  lookupCont_ [Occ=LoopBreakerT[5]]
    
    746 743
                                    :: Eq k => Word -> k -> Int -> HashMap k a -> Bool
    
    ... ... @@ -868,8 +865,7 @@ T26615a.$wdisjointSubtrees [InlPrag=INLINABLE[2], Occ=LoopBreaker]
    868 865
                                      }
    
    869 866
                                      }; } in
    
    870 867
                                jump lookupCont_
    
    871
    -                             $dEq (GHC.Internal.Types.W# bx) k0 (GHC.Internal.Types.I# ww) ds
    
    872
    -                           }
    
    868
    +                             $dEq (GHC.Internal.Types.W# bx) kB (GHC.Internal.Types.I# ww) ds
    
    873 869
                                };
    
    874 870
                              Collision _ [Occ=Dead] _ [Occ=Dead] ->
    
    875 871
                                T26615a.$wdisjointSubtrees @k @b @a $dEq ww wild ds
    
    ... ... @@ -880,7 +876,6 @@ T26615a.$wdisjointSubtrees [InlPrag=INLINABLE[2], Occ=LoopBreaker]
    880 876
                          case ds1 of { L kA [Occ=Once2] _ [Occ=Dead] ->
    
    881 877
                          case _b of wild2 [Occ=Once1] {
    
    882 878
                            __DEFAULT ->
    
    883
    -                         case kA of k0 [Occ=Once1] { __DEFAULT ->
    
    884 879
                              joinrec {
    
    885 880
                                lookupCont_ [Occ=LoopBreakerT[5]]
    
    886 881
                                  :: Eq k => Word -> k -> Int -> HashMap k b -> Bool
    
    ... ... @@ -1004,8 +999,11 @@ T26615a.$wdisjointSubtrees [InlPrag=INLINABLE[2], Occ=LoopBreaker]
    1004 999
                                    }
    
    1005 1000
                                    }; } in
    
    1006 1001
                              jump lookupCont_
    
    1007
    -                           $dEq (GHC.Internal.Types.W# bx) k0 (GHC.Internal.Types.I# ww) wild2
    
    1008
    -                         };
    
    1002
    +                           $dEq
    
    1003
    +                           (GHC.Internal.Types.W# bx)
    
    1004
    +                           kA
    
    1005
    +                           (GHC.Internal.Types.I# ww)
    
    1006
    +                           wild2;
    
    1009 1007
                            Leaf bx1 [Occ=Once1] ds3 [Occ=Once1!] ->
    
    1010 1008
                              case ds3 of { L kB [Occ=Once1] _ [Occ=Dead] ->
    
    1011 1009
                              case GHC.Internal.Classes.neWord
    
    ... ... @@ -1091,13 +1089,14 @@ T26615a.$wdisjointSubtrees [InlPrag=INLINABLE[2], Occ=LoopBreaker]
    1091 1089
                                        [LclId[JoinId(1)(Nothing)], Arity=1, Str=<L>, Unf=OtherCon []]
    
    1092 1090
                                        go (ds1 [Occ=Once1!] :: Word)
    
    1093 1091
                                          = case ds1 of { W# ds2 [Occ=Once1!] ->
    
    1094
    -                                       case ds2 of ds3 {
    
    1092
    +                                       case ds2 of wild5 {
    
    1095 1093
                                              __DEFAULT ->
    
    1096 1094
                                                let {
    
    1097 1095
                                                  m :: Word#
    
    1098 1096
                                                  [LclId]
    
    1099 1097
                                                  m = and#
    
    1100
    -                                                   ds3 (int2Word# (negateInt# (word2Int# ds3))) } in
    
    1098
    +                                                   wild5
    
    1099
    +                                                   (int2Word# (negateInt# (word2Int# wild5))) } in
    
    1101 1100
                                                case indexSmallArray#
    
    1102 1101
                                                       @Lifted
    
    1103 1102
                                                       @(HashMap k a)
    
    ... ... @@ -1118,7 +1117,7 @@ T26615a.$wdisjointSubtrees [InlPrag=INLINABLE[2], Occ=LoopBreaker]
    1118 1117
                                                of {
    
    1119 1118
                                                  False -> GHC.Internal.Types.False;
    
    1120 1119
                                                  True ->
    
    1121
    -                                               jump go (GHC.Internal.Types.W# (and# ds3 (not# m)))
    
    1120
    +                                               jump go (GHC.Internal.Types.W# (and# wild5 (not# m)))
    
    1122 1121
                                                }
    
    1123 1122
                                                }
    
    1124 1123
                                                };
    
    ... ... @@ -1137,12 +1136,12 @@ T26615a.$wdisjointSubtrees [InlPrag=INLINABLE[2], Occ=LoopBreaker]
    1137 1136
                                [LclId[JoinId(1)(Nothing)], Arity=1, Str=<L>, Unf=OtherCon []]
    
    1138 1137
                                go (ds1 [Occ=Once1!] :: Word)
    
    1139 1138
                                  = case ds1 of { W# ds2 [Occ=Once1!] ->
    
    1140
    -                               case ds2 of ds3 {
    
    1139
    +                               case ds2 of wild3 {
    
    1141 1140
                                      __DEFAULT ->
    
    1142 1141
                                        let {
    
    1143 1142
                                          m :: Word#
    
    1144 1143
                                          [LclId]
    
    1145
    -                                     m = and# ds3 (int2Word# (negateInt# (word2Int# ds3))) } in
    
    1144
    +                                     m = and# wild3 (int2Word# (negateInt# (word2Int# wild3))) } in
    
    1146 1145
                                        case indexSmallArray#
    
    1147 1146
                                               @Lifted
    
    1148 1147
                                               @(HashMap k a)
    
    ... ... @@ -1161,7 +1160,7 @@ T26615a.$wdisjointSubtrees [InlPrag=INLINABLE[2], Occ=LoopBreaker]
    1161 1160
                                        case T26615a.$wdisjointSubtrees @k @a @b $dEq (+# ww 5#) ipv ipv1
    
    1162 1161
                                        of {
    
    1163 1162
                                          False -> GHC.Internal.Types.False;
    
    1164
    -                                     True -> jump go (GHC.Internal.Types.W# (and# ds3 (not# m)))
    
    1163
    +                                     True -> jump go (GHC.Internal.Types.W# (and# wild3 (not# m)))
    
    1165 1164
                                        }
    
    1166 1165
                                        }
    
    1167 1166
                                        };
    
    ... ... @@ -1179,12 +1178,12 @@ T26615a.$wdisjointSubtrees [InlPrag=INLINABLE[2], Occ=LoopBreaker]
    1179 1178
                                [LclId[JoinId(1)(Nothing)], Arity=1, Str=<L>, Unf=OtherCon []]
    
    1180 1179
                                go (ds1 [Occ=Once1!] :: Word)
    
    1181 1180
                                  = case ds1 of { W# ds2 [Occ=Once1!] ->
    
    1182
    -                               case ds2 of ds3 {
    
    1181
    +                               case ds2 of wild3 {
    
    1183 1182
                                      __DEFAULT ->
    
    1184 1183
                                        let {
    
    1185 1184
                                          m :: Word#
    
    1186 1185
                                          [LclId]
    
    1187
    -                                     m = and# ds3 (int2Word# (negateInt# (word2Int# ds3))) } in
    
    1186
    +                                     m = and# wild3 (int2Word# (negateInt# (word2Int# wild3))) } in
    
    1188 1187
                                        case indexSmallArray#
    
    1189 1188
                                               @Lifted
    
    1190 1189
                                               @(HashMap k a)
    
    ... ... @@ -1203,7 +1202,7 @@ T26615a.$wdisjointSubtrees [InlPrag=INLINABLE[2], Occ=LoopBreaker]
    1203 1202
                                        case T26615a.$wdisjointSubtrees @k @a @b $dEq (+# ww 5#) ipv ipv1
    
    1204 1203
                                        of {
    
    1205 1204
                                          False -> GHC.Internal.Types.False;
    
    1206
    -                                     True -> jump go (GHC.Internal.Types.W# (and# ds3 (not# m)))
    
    1205
    +                                     True -> jump go (GHC.Internal.Types.W# (and# wild3 (not# m)))
    
    1207 1206
                                        }
    
    1208 1207
                                        }
    
    1209 1208
                                        };
    
    ... ... @@ -1277,7 +1276,6 @@ T26615a.$wdisjointSubtrees
    1277 1276
                   Empty -> GHC.Internal.Types.True;
    
    1278 1277
                   Leaf bx ds2 ->
    
    1279 1278
                     case ds2 of { L kB ds3 ->
    
    1280
    -                case kB of k0 { __DEFAULT ->
    
    1281 1279
                     join {
    
    1282 1280
                       exit [Dmd=LC(S,C(1,C(1,C(1,L))))]
    
    1283 1281
                         :: Word# -> k -> Word# -> Leaf k a -> Bool
    
    ... ... @@ -1392,8 +1390,7 @@ T26615a.$wdisjointSubtrees
    1392 1390
                               }
    
    1393 1391
                           }
    
    1394 1392
                           }; } in
    
    1395
    -                jump $wlookupCont_ $dEq bx k0 ww ds
    
    1396
    -                }
    
    1393
    +                jump $wlookupCont_ $dEq bx kB ww ds
    
    1397 1394
                     };
    
    1398 1395
                   Collision bx bx1 ->
    
    1399 1396
                     T26615a.disjointSubtrees_$s$wdisjointSubtrees
    
    ... ... @@ -1405,7 +1402,6 @@ T26615a.$wdisjointSubtrees
    1405 1402
               case ds1 of { L kA ds2 ->
    
    1406 1403
               case _b of wild2 {
    
    1407 1404
                 __DEFAULT ->
    
    1408
    -              case kA of k0 { __DEFAULT ->
    
    1409 1405
                   join {
    
    1410 1406
                     exit [Dmd=LC(S,C(1,C(1,C(1,L))))]
    
    1411 1407
                       :: Word# -> k -> Word# -> Leaf k b -> Bool
    
    ... ... @@ -1519,8 +1515,7 @@ T26615a.$wdisjointSubtrees
    1519 1515
                             }
    
    1520 1516
                         }
    
    1521 1517
                         }; } in
    
    1522
    -              jump $wlookupCont_ $dEq bx k0 ww wild2
    
    1523
    -              };
    
    1518
    +              jump $wlookupCont_ $dEq bx kA ww wild2;
    
    1524 1519
                 Leaf bx1 ds3 ->
    
    1525 1520
                   case ds3 of { L kB ds4 ->
    
    1526 1521
                   case neWord# bx bx1 of {
    
    ... ... @@ -1604,12 +1599,12 @@ T26615a.$wdisjointSubtrees
    1604 1599
                             $wgo [InlPrag=[2], Occ=LoopBreaker, Dmd=SC(S,L)] :: Word# -> Bool
    
    1605 1600
                             [LclId[JoinId(1)(Nothing)], Arity=1, Str=<1L>, Unf=OtherCon []]
    
    1606 1601
                             $wgo (ww1 :: Word#)
    
    1607
    -                          = case ww1 of ds1 {
    
    1602
    +                          = case ww1 of wild4 {
    
    1608 1603
                                   __DEFAULT ->
    
    1609 1604
                                     let {
    
    1610 1605
                                       m :: Word#
    
    1611 1606
                                       [LclId]
    
    1612
    -                                  m = and# ds1 (int2Word# (negateInt# (word2Int# ds1))) } in
    
    1607
    +                                  m = and# wild4 (int2Word# (negateInt# (word2Int# wild4))) } in
    
    1613 1608
                                     case indexSmallArray#
    
    1614 1609
                                            @Lifted
    
    1615 1610
                                            @(HashMap k a)
    
    ... ... @@ -1626,7 +1621,7 @@ T26615a.$wdisjointSubtrees
    1626 1621
                                     { (# ipv1 #) ->
    
    1627 1622
                                     case T26615a.$wdisjointSubtrees @k @a @b $dEq lvl2 ipv ipv1 of {
    
    1628 1623
                                       False -> GHC.Internal.Types.False;
    
    1629
    -                                  True -> jump $wgo (and# ds1 (not# m))
    
    1624
    +                                  True -> jump $wgo (and# wild4 (not# m))
    
    1630 1625
                                     }
    
    1631 1626
                                     }
    
    1632 1627
                                     };
    
    ... ... @@ -1647,12 +1642,12 @@ T26615a.$wdisjointSubtrees
    1647 1642
                     $wgo [InlPrag=[2], Occ=LoopBreaker, Dmd=SC(S,L)] :: Word# -> Bool
    
    1648 1643
                     [LclId[JoinId(1)(Nothing)], Arity=1, Str=<1L>, Unf=OtherCon []]
    
    1649 1644
                     $wgo (ww1 :: Word#)
    
    1650
    -                  = case ww1 of ds1 {
    
    1645
    +                  = case ww1 of wild2 {
    
    1651 1646
                           __DEFAULT ->
    
    1652 1647
                             let {
    
    1653 1648
                               m :: Word#
    
    1654 1649
                               [LclId]
    
    1655
    -                          m = and# ds1 (int2Word# (negateInt# (word2Int# ds1))) } in
    
    1650
    +                          m = and# wild2 (int2Word# (negateInt# (word2Int# wild2))) } in
    
    1656 1651
                             case indexSmallArray#
    
    1657 1652
                                    @Lifted
    
    1658 1653
                                    @(HashMap k a)
    
    ... ... @@ -1669,7 +1664,7 @@ T26615a.$wdisjointSubtrees
    1669 1664
                             { (# ipv1 #) ->
    
    1670 1665
                             case T26615a.$wdisjointSubtrees @k @a @b $dEq lvl2 ipv ipv1 of {
    
    1671 1666
                               False -> GHC.Internal.Types.False;
    
    1672
    -                          True -> jump $wgo (and# ds1 (not# m))
    
    1667
    +                          True -> jump $wgo (and# wild2 (not# m))
    
    1673 1668
                             }
    
    1674 1669
                             }
    
    1675 1670
                             };
    
    ... ... @@ -1689,12 +1684,12 @@ T26615a.$wdisjointSubtrees
    1689 1684
                     $wgo [InlPrag=[2], Occ=LoopBreaker, Dmd=SC(S,L)] :: Word# -> Bool
    
    1690 1685
                     [LclId[JoinId(1)(Nothing)], Arity=1, Str=<1L>, Unf=OtherCon []]
    
    1691 1686
                     $wgo (ww1 :: Word#)
    
    1692
    -                  = case ww1 of ds1 {
    
    1687
    +                  = case ww1 of wild2 {
    
    1693 1688
                           __DEFAULT ->
    
    1694 1689
                             let {
    
    1695 1690
                               m :: Word#
    
    1696 1691
                               [LclId]
    
    1697
    -                          m = and# ds1 (int2Word# (negateInt# (word2Int# ds1))) } in
    
    1692
    +                          m = and# wild2 (int2Word# (negateInt# (word2Int# wild2))) } in
    
    1698 1693
                             case indexSmallArray#
    
    1699 1694
                                    @Lifted
    
    1700 1695
                                    @(HashMap k a)
    
    ... ... @@ -1711,7 +1706,7 @@ T26615a.$wdisjointSubtrees
    1711 1706
                             { (# ipv1 #) ->
    
    1712 1707
                             case T26615a.$wdisjointSubtrees @k @a @b $dEq lvl2 ipv ipv1 of {
    
    1713 1708
                               False -> GHC.Internal.Types.False;
    
    1714
    -                          True -> jump $wgo (and# ds1 (not# m))
    
    1709
    +                          True -> jump $wgo (and# wild2 (not# m))
    
    1715 1710
                             }
    
    1716 1711
                             }
    
    1717 1712
                             };
    
    ... ... @@ -1845,32 +1840,7 @@ disjointSubtrees
    1845 1840
     
    
    1846 1841
     ==================== Tidy Core ====================
    
    1847 1842
     Result size of Tidy Core
    
    1848
    -  = {terms: 622, types: 674, coercions: 18, joins: 8/14}
    
    1849
    -
    
    1850
    --- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
    
    1851
    -$trModule1 :: GHC.Internal.Prim.Addr#
    
    1852
    -[GblId, Unf=OtherCon []]
    
    1853
    -$trModule1 = "T26615"#
    
    1854
    -
    
    1855
    --- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
    
    1856
    -$trModule2 :: GHC.Internal.Types.TrName
    
    1857
    -[GblId, Unf=OtherCon []]
    
    1858
    -$trModule2 = GHC.Internal.Types.TrNameS $trModule1
    
    1859
    -
    
    1860
    --- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
    
    1861
    -$trModule3 :: GHC.Internal.Prim.Addr#
    
    1862
    -[GblId, Unf=OtherCon []]
    
    1863
    -$trModule3 = "main"#
    
    1864
    -
    
    1865
    --- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
    
    1866
    -$trModule4 :: GHC.Internal.Types.TrName
    
    1867
    -[GblId, Unf=OtherCon []]
    
    1868
    -$trModule4 = GHC.Internal.Types.TrNameS $trModule3
    
    1869
    -
    
    1870
    --- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
    
    1871
    -T26615.$trModule [InlPrag=[~]] :: GHC.Internal.Types.Module
    
    1872
    -[GblId, Unf=OtherCon []]
    
    1873
    -T26615.$trModule = GHC.Internal.Types.Module $trModule4 $trModule2
    
    1843
    +  = {terms: 603, types: 666, coercions: 18, joins: 8/14}
    
    1874 1844
     
    
    1875 1845
     -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
    
    1876 1846
     lvl :: GHC.Internal.Prim.Addr#
    
    ... ... @@ -2029,7 +1999,7 @@ $wpoly_lookupCont_
    2029 1999
     end Rec }
    
    2030 2000
     
    
    2031 2001
     Rec {
    
    2032
    --- RHS size: {terms: 450, types: 507, coercions: 18, joins: 8/13}
    
    2002
    +-- RHS size: {terms: 445, types: 504, coercions: 18, joins: 8/13}
    
    2033 2003
     T26615.$s$wdisjointSubtrees [InlPrag=[~], Occ=LoopBreaker]
    
    2034 2004
       :: forall a b.
    
    2035 2005
          GHC.Internal.Prim.Int#
    
    ... ... @@ -2067,11 +2037,7 @@ T26615.$s$wdisjointSubtrees
    2067 2037
                 T26615a.Leaf bx1 ds3 ->
    
    2068 2038
                   case ds3 of { T26615a.L kB ds4 ->
    
    2069 2039
                   case GHC.Internal.Prim.neWord# bx bx1 of {
    
    2070
    -                __DEFAULT ->
    
    2071
    -                  case GHC.Internal.Classes.$fEqList_$s$c==1 kA kB of {
    
    2072
    -                    False -> GHC.Internal.Types.True;
    
    2073
    -                    True -> GHC.Internal.Types.False
    
    2074
    -                  };
    
    2040
    +                __DEFAULT -> GHC.Internal.Classes.$fEqList_$s$c/=1 kA kB;
    
    2075 2041
                     1# -> GHC.Internal.Types.True
    
    2076 2042
                   }
    
    2077 2043
                   }
    
    ... ... @@ -2094,14 +2060,14 @@ T26615.$s$wdisjointSubtrees
    2094 2060
                         $s$wfoldr_ [InlPrag=[2],
    
    2095 2061
                                     Occ=LoopBreaker,
    
    2096 2062
                                     Dmd=SC(S,C(1,C(1,C(1,L))))]
    
    2097
    -                      :: GHC.Internal.Prim.SmallArray# (T26615a.Leaf [Char] a)
    
    2063
    +                      :: GHC.Internal.Prim.SmallArray# (T26615a.Leaf String a)
    
    2098 2064
                              -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int# -> Bool -> Bool
    
    2099 2065
                         [LclId[JoinId(4)(Nothing)],
    
    2100 2066
                          Arity=4,
    
    2101 2067
                          Str=<L><L><L><L>,
    
    2102 2068
                          Unf=OtherCon []]
    
    2103 2069
                         $s$wfoldr_ (sc
    
    2104
    -                                  :: GHC.Internal.Prim.SmallArray# (T26615a.Leaf [Char] a))
    
    2070
    +                                  :: GHC.Internal.Prim.SmallArray# (T26615a.Leaf String a))
    
    2105 2071
                                    (sc1 :: GHC.Internal.Prim.Int#)
    
    2106 2072
                                    (sc2 :: GHC.Internal.Prim.Int#)
    
    2107 2073
                                    (sc3 :: Bool)
    
    ... ... @@ -2243,16 +2209,16 @@ T26615.$s$wdisjointSubtrees
    2243 2209
                               :: GHC.Internal.Prim.Word# -> Bool
    
    2244 2210
                             [LclId[JoinId(1)(Nothing)], Arity=1, Str=<1L>, Unf=OtherCon []]
    
    2245 2211
                             $wgo (ww1 :: GHC.Internal.Prim.Word#)
    
    2246
    -                          = case ww1 of ds3 {
    
    2212
    +                          = case ww1 of wild5 {
    
    2247 2213
                                   __DEFAULT ->
    
    2248 2214
                                     let {
    
    2249 2215
                                       m :: GHC.Internal.Prim.Word#
    
    2250 2216
                                       [LclId]
    
    2251 2217
                                       m = GHC.Internal.Prim.and#
    
    2252
    -                                        ds3
    
    2218
    +                                        wild5
    
    2253 2219
                                             (GHC.Internal.Prim.int2Word#
    
    2254 2220
                                                (GHC.Internal.Prim.negateInt#
    
    2255
    -                                              (GHC.Internal.Prim.word2Int# ds3))) } in
    
    2221
    +                                              (GHC.Internal.Prim.word2Int# wild5))) } in
    
    2256 2222
                                     case GHC.Internal.Prim.indexSmallArray#
    
    2257 2223
                                            @GHC.Internal.Types.Lifted
    
    2258 2224
                                            @(HashMap String a)
    
    ... ... @@ -2279,7 +2245,7 @@ T26615.$s$wdisjointSubtrees
    2279 2245
                                       False -> GHC.Internal.Types.False;
    
    2280 2246
                                       True ->
    
    2281 2247
                                         jump $wgo
    
    2282
    -                                      (GHC.Internal.Prim.and# ds3 (GHC.Internal.Prim.not# m))
    
    2248
    +                                      (GHC.Internal.Prim.and# wild5 (GHC.Internal.Prim.not# m))
    
    2283 2249
                                     }
    
    2284 2250
                                     }
    
    2285 2251
                                     };
    
    ... ... @@ -2297,16 +2263,16 @@ T26615.$s$wdisjointSubtrees
    2297 2263
                       :: GHC.Internal.Prim.Word# -> Bool
    
    2298 2264
                     [LclId[JoinId(1)(Nothing)], Arity=1, Str=<1L>, Unf=OtherCon []]
    
    2299 2265
                     $wgo (ww1 :: GHC.Internal.Prim.Word#)
    
    2300
    -                  = case ww1 of ds3 {
    
    2266
    +                  = case ww1 of wild3 {
    
    2301 2267
                           __DEFAULT ->
    
    2302 2268
                             let {
    
    2303 2269
                               m :: GHC.Internal.Prim.Word#
    
    2304 2270
                               [LclId]
    
    2305 2271
                               m = GHC.Internal.Prim.and#
    
    2306
    -                                ds3
    
    2272
    +                                wild3
    
    2307 2273
                                     (GHC.Internal.Prim.int2Word#
    
    2308 2274
                                        (GHC.Internal.Prim.negateInt#
    
    2309
    -                                      (GHC.Internal.Prim.word2Int# ds3))) } in
    
    2275
    +                                      (GHC.Internal.Prim.word2Int# wild3))) } in
    
    2310 2276
                             case GHC.Internal.Prim.indexSmallArray#
    
    2311 2277
                                    @GHC.Internal.Types.Lifted
    
    2312 2278
                                    @(HashMap String a)
    
    ... ... @@ -2332,7 +2298,7 @@ T26615.$s$wdisjointSubtrees
    2332 2298
                             of {
    
    2333 2299
                               False -> GHC.Internal.Types.False;
    
    2334 2300
                               True ->
    
    2335
    -                            jump $wgo (GHC.Internal.Prim.and# ds3 (GHC.Internal.Prim.not# m))
    
    2301
    +                            jump $wgo (GHC.Internal.Prim.and# wild3 (GHC.Internal.Prim.not# m))
    
    2336 2302
                             }
    
    2337 2303
                             }
    
    2338 2304
                             };
    
    ... ... @@ -2349,16 +2315,16 @@ T26615.$s$wdisjointSubtrees
    2349 2315
                       :: GHC.Internal.Prim.Word# -> Bool
    
    2350 2316
                     [LclId[JoinId(1)(Nothing)], Arity=1, Str=<1L>, Unf=OtherCon []]
    
    2351 2317
                     $wgo (ww1 :: GHC.Internal.Prim.Word#)
    
    2352
    -                  = case ww1 of ds3 {
    
    2318
    +                  = case ww1 of wild3 {
    
    2353 2319
                           __DEFAULT ->
    
    2354 2320
                             let {
    
    2355 2321
                               m :: GHC.Internal.Prim.Word#
    
    2356 2322
                               [LclId]
    
    2357 2323
                               m = GHC.Internal.Prim.and#
    
    2358
    -                                ds3
    
    2324
    +                                wild3
    
    2359 2325
                                     (GHC.Internal.Prim.int2Word#
    
    2360 2326
                                        (GHC.Internal.Prim.negateInt#
    
    2361
    -                                      (GHC.Internal.Prim.word2Int# ds3))) } in
    
    2327
    +                                      (GHC.Internal.Prim.word2Int# wild3))) } in
    
    2362 2328
                             case GHC.Internal.Prim.indexSmallArray#
    
    2363 2329
                                    @GHC.Internal.Types.Lifted
    
    2364 2330
                                    @(HashMap String a)
    
    ... ... @@ -2384,7 +2350,7 @@ T26615.$s$wdisjointSubtrees
    2384 2350
                             of {
    
    2385 2351
                               False -> GHC.Internal.Types.False;
    
    2386 2352
                               True ->
    
    2387
    -                            jump $wgo (GHC.Internal.Prim.and# ds3 (GHC.Internal.Prim.not# m))
    
    2353
    +                            jump $wgo (GHC.Internal.Prim.and# wild3 (GHC.Internal.Prim.not# m))
    
    2388 2354
                             }
    
    2389 2355
                             }
    
    2390 2356
                             };
    

  • testsuite/tests/simplCore/should_compile/all.T
    ... ... @@ -602,6 +602,7 @@ test('T26615', [grep_errmsg(r'fEqList')], multimod_compile, ['T26615', '-O -fsp
    602 602
     # T26722: there should be no reboxing in $wg
    
    603 603
     test('T26722', [grep_errmsg(r'SPEC')], compile, ['-O -dno-typeable-binds'])
    
    604 604
     
    
    605
    +test('T26548', normal, compile, ['-O -ddump-simpl -dsuppress-uniques -dno-typeable-binds'])
    
    605 606
     test('T26805', [grep_errmsg(r'fromInteger')], compile, ['-O -dno-typeable-binds -ddump-simpl -dsuppress-uniques'])
    
    606 607
     test('T26826', normal, compile, ['-O'])
    
    607 608
     test('T26903', [grep_errmsg(r'reverse')], compile, ['-O -dno-typeable-binds -ddump-simpl -dsuppress-uniques -dsuppress-all'])