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

Commits:

5 changed files:

Changes:

  • compiler/GHC/Core/Opt/OccurAnal.hs
    ... ... @@ -3797,8 +3797,9 @@ lookupOccInfoByUnique (UD { ud_env = env
    3797 3797
                         , occ_int_cxt = int_cxt
    
    3798 3798
                         , occ_tail    = mk_tail_info tail_info }
    
    3799 3799
              where
    
    3800
    -           in_lam | uniq `elemVarEnvByKey` z_in_lam = IsInsideLam
    
    3801
    -                  | otherwise                       = NotInsideLam
    
    3800
    +           in_lam | uniq `elemVarEnvByKey` z_in_lam
    
    3801
    +                  , n_br > 0    = IsInsideLam
    
    3802
    +                  | otherwise   = NotInsideLam
    
    3802 3803
     
    
    3803 3804
           Just (ManyOccL tail_info) -> ManyOccs { occ_tail = mk_tail_info tail_info }
    
    3804 3805
       where
    

  • testsuite/tests/arityanal/should_compile/T18793.stderr
    1 1
     
    
    2 2
     ==================== Tidy Core ====================
    
    3
    -Result size of Tidy Core = {terms: 64, types: 40, coercions: 0, joins: 0/0}
    
    3
    +Result size of Tidy Core = {terms: 60, types: 34, coercions: 0, joins: 0/0}
    
    4 4
     
    
    5 5
     -- RHS size: {terms: 17, types: 7, coercions: 0, joins: 0/0}
    
    6 6
     stuff [InlPrag=NOINLINE] :: Int -> [Int]
    
    7 7
     [GblId, Arity=1, Str=<1L>, Unf=OtherCon []]
    
    8
    -stuff = \ (i :: Int) -> case i of i1 { GHC.Types.I# ipv -> GHC.Types.: @Int i1 (GHC.Types.: @Int (GHC.Types.I# (GHC.Prim.+# ipv 1#)) (GHC.Types.: @Int (GHC.Types.I# (GHC.Prim.+# ipv 2#)) (GHC.Types.[] @Int))) }
    
    8
    +stuff = \ (i :: Int) -> case i of i1 { GHC.Internal.Types.I# ipv -> GHC.Internal.Types.: @Int i1 (GHC.Internal.Types.: @Int (GHC.Internal.Types.I# (GHC.Internal.Prim.+# ipv 1#)) (GHC.Internal.Types.: @Int (GHC.Internal.Types.I# (GHC.Internal.Prim.+# ipv 2#)) (GHC.Internal.Types.[] @Int))) }
    
    9 9
     
    
    10 10
     Rec {
    
    11 11
     -- RHS size: {terms: 23, types: 11, coercions: 0, joins: 0/0}
    
    12
    -T18793.$wgo1 [InlPrag=[2], Occ=LoopBreaker] :: [Int] -> GHC.Prim.Int# -> GHC.Prim.Int#
    
    12
    +T18793.$wgo1 [InlPrag=[2], Occ=LoopBreaker] :: [Int] -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int#
    
    13 13
     [GblId[StrictWorker([!])], Arity=2, Str=<1L><L>, Unf=OtherCon []]
    
    14 14
     T18793.$wgo1
    
    15
    -  = \ (ds :: [Int]) (ww :: GHC.Prim.Int#) ->
    
    15
    +  = \ (ds :: [Int]) (ww :: GHC.Internal.Prim.Int#) ->
    
    16 16
           case ds of {
    
    17 17
             [] -> ww;
    
    18 18
             : y ys ->
    
    19
    -          case y of { GHC.Types.I# x ->
    
    20
    -          case GHC.Prim.># x 42# of {
    
    19
    +          case y of { GHC.Internal.Types.I# x ->
    
    20
    +          case GHC.Internal.Prim.># x 42# of {
    
    21 21
                 __DEFAULT -> T18793.$wgo1 ys ww;
    
    22
    -            1# -> T18793.$wgo1 ys (GHC.Prim.negateInt# ww)
    
    22
    +            1# -> T18793.$wgo1 ys (GHC.Internal.Prim.negateInt# ww)
    
    23 23
               }
    
    24 24
               }
    
    25 25
           }
    
    26 26
     end Rec }
    
    27 27
     
    
    28
    --- RHS size: {terms: 12, types: 6, coercions: 0, joins: 0/0}
    
    29
    -T18793.f_go1 [InlPrag=[2]] :: [Int] -> Int -> Int
    
    30
    -[GblId,
    
    31
    - Arity=2,
    
    32
    - Str=<1L><1!P(L)>,
    
    33
    - Cpr=1,
    
    34
    - Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=False)
    
    35
    -         Tmpl= \ (ds [Occ=Once1] :: [Int]) (eta [Occ=Once1!, OS=OneShot] :: Int) -> case eta of { GHC.Types.I# ww [Occ=Once1] -> case T18793.$wgo1 ds ww of ww1 [Occ=Once1] { __DEFAULT -> GHC.Types.I# ww1 } }}]
    
    36
    -T18793.f_go1 = \ (ds :: [Int]) (eta [OS=OneShot] :: Int) -> case eta of { GHC.Types.I# ww -> case T18793.$wgo1 ds ww of ww1 { __DEFAULT -> GHC.Types.I# ww1 } }
    
    37
    -
    
    38 28
     -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
    
    39 29
     T18793.f2 :: Int
    
    40 30
     [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}]
    
    41
    -T18793.f2 = GHC.Types.I# 1#
    
    31
    +T18793.f2 = GHC.Internal.Types.I# 1#
    
    42 32
     
    
    43 33
     -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
    
    44 34
     T18793.f1 :: [Int]
    
    45 35
     [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False, WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
    
    46 36
     T18793.f1 = stuff T18793.f2
    
    47 37
     
    
    48
    --- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
    
    38
    +-- RHS size: {terms: 11, types: 4, coercions: 0, joins: 0/0}
    
    49 39
     f :: Int -> Int
    
    50
    -[GblId, Arity=1, Str=<1!P(L)>, Cpr=1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 60}]
    
    51
    -f = T18793.f_go1 T18793.f1
    
    40
    +[GblId, Arity=1, Str=<1!P(L)>, Cpr=1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [20] 60 10}]
    
    41
    +f = \ (eta [OS=OneShot] :: Int) -> case eta of { GHC.Internal.Types.I# ww -> case T18793.$wgo1 T18793.f1 ww of ww1 { __DEFAULT -> GHC.Internal.Types.I# ww1 } }
    
    52 42
     
    
    53 43
     
    
    54 44
     

  • testsuite/tests/driver/inline-check.stderr
    ... ... @@ -17,7 +17,6 @@ Inactive unfolding: foo1
    17 17
     Inactive unfolding: foo1
    
    18 18
     Inactive unfolding: foo1
    
    19 19
     Inactive unfolding: foo1
    
    20
    -Inactive unfolding: foo1
    
    21 20
     Considering inlining: foo
    
    22 21
       arg infos []
    
    23 22
       interesting continuation RhsCtxt(NonRecursive)
    

  • testsuite/tests/ghci.debugger/scripts/break011.stdout
    ... ... @@ -29,9 +29,9 @@ HasCallStack backtrace:
    29 29
       error, called at Test7.hs:2:18 in main:Main
    
    30 30
     
    
    31 31
     Stopped in <exception thrown>, <unknown>
    
    32
    -_exception :: e = SomeException (ErrorCall "foo")
    
    32
    +_exception :: e = _
    
    33 33
     Stopped in <exception thrown>, <unknown>
    
    34
    -_exception :: e = SomeException (ErrorCall "foo")
    
    34
    +_exception :: e = _
    
    35 35
     *** Exception: foo
    
    36 36
     
    
    37 37
     HasCallStack backtrace:
    

  • testsuite/tests/ghci.debugger/scripts/break024.stdout
    ... ... @@ -17,9 +17,7 @@ _exception = SomeException
    17 17
                       Nothing GHC.Internal.IO.Exception.UserError [] "error" Nothing
    
    18 18
                       Nothing)
    
    19 19
     Stopped in <exception thrown>, <unknown>
    
    20
    -_exception :: e = SomeException
    
    21
    -                    (GHC.Internal.IO.Exception.IOError
    
    22
    -                       Nothing GHC.Internal.IO.Exception.UserError ....)
    
    20
    +_exception :: e = _
    
    23 21
     Stopped in <exception thrown>, <unknown>
    
    24 22
     _exception :: e = _
    
    25 23
     _exception = SomeException