Simon Jakobi pushed to branch wip/sjakobi/T4081 at Glasgow Haskell Compiler / GHC

Commits:

3 changed files:

Changes:

  • testsuite/tests/simplCore/should_compile/T4081.hs
    1
    +-- #4081: the strict field of T should be unboxed once, outside the blah loop,
    
    2
    +-- not re-inspected on every iteration. See the expected Core in T4081.stderr.
    
    3
    +
    
    4
    +module T4081 (foo) where
    
    5
    +
    
    6
    +data T a = T !a
    
    7
    +
    
    8
    +foo :: T Int -> Int -> Int
    
    9
    +foo (T x) y = let blah 0 = 0
    
    10
    +                  blah n = x + blah (n-1)
    
    11
    +              in blah y

  • testsuite/tests/simplCore/should_compile/T4081.stderr
    1
    +
    
    2
    +==================== Tidy Core ====================
    
    3
    +Result size of Tidy Core
    
    4
    +  = {terms: 40, types: 25, coercions: 0, joins: 0/1}
    
    5
    +
    
    6
    +$wfoo
    
    7
    +  = \ ww ww1 ->
    
    8
    +      letrec {
    
    9
    +        $wblah
    
    10
    +          = \ ww2 ->
    
    11
    +              case ww2 of ds {
    
    12
    +                __DEFAULT ->
    
    13
    +                  case $wblah (-# ds 1#) of ww3 { __DEFAULT -> +# ww ww3 };
    
    14
    +                0# -> 0#
    
    15
    +              }; } in
    
    16
    +      $wblah ww1
    
    17
    +
    
    18
    +foo
    
    19
    +  = \ ds y ->
    
    20
    +      case ds of { T ww ->
    
    21
    +      case ww of { I# ww1 ->
    
    22
    +      case y of { I# ww2 ->
    
    23
    +      case $wfoo ww1 ww2 of ww3 { __DEFAULT -> I# ww3 }
    
    24
    +      }
    
    25
    +      }
    
    26
    +      }
    
    27
    +
    
    28
    +
    
    29
    +

  • testsuite/tests/simplCore/should_compile/all.T
    ... ... @@ -601,4 +601,6 @@ test('T25718a', normal, compile, ['-O -ddump-simpl -dsuppress-uniques -dsuppress
    601 601
     test('T25718b', normal, compile, ['-O -ddump-simpl -dsuppress-uniques -dsuppress-all -dno-typeable-binds'])
    
    602 602
     test('T25718c', normal, compile, ['-O -ddump-simpl -dsuppress-uniques -dsuppress-all -dno-typeable-binds'])
    
    603 603
     test('T19166', normal, compile, ['-O -ddump-simpl -dsuppress-uniques -dsuppress-all -dno-typeable-binds'])
    
    604
    +# #4081: the strict field of T should be unboxed once, outside the loop.
    
    605
    +test('T4081', normal, compile, ['-O -ddump-simpl -dsuppress-uniques -dsuppress-all -dno-typeable-binds'])
    
    604 606
     test('T27261', [extra_files(['T27261_aux.hs'])], multimod_compile, ['T27261', '-v0 -O'])