[Git][ghc/ghc][wip/simplifier-tweaks] More wibbles

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Thu Mar 28 17:33:08 UTC 2024



Simon Peyton Jones pushed to branch wip/simplifier-tweaks at Glasgow Haskell Compiler / GHC


Commits:
1fbbc520 by Simon Peyton Jones at 2024-03-28T17:32:55+00:00
More wibbles

- - - - -


4 changed files:

- testsuite/tests/arityanal/should_compile/Arity09.stderr
- testsuite/tests/simplCore/should_compile/T18013.stderr
- testsuite/tests/simplCore/should_compile/T20040.stderr
- testsuite/tests/simplStg/should_compile/T15226b.stderr


Changes:

=====================================
testsuite/tests/arityanal/should_compile/Arity09.stderr
=====================================
@@ -1,16 +1,11 @@
 
 ==================== Tidy Core ====================
-Result size of Tidy Core = {terms: 28, types: 8, coercions: 0, joins: 0/0}
+Result size of Tidy Core = {terms: 38, types: 11, coercions: 0, joins: 0/0}
 
 -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
 lvl :: Integer
 [GblId, Unf=OtherCon []]
-lvl = GHC.Num.Integer.IS 100#
-
--- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
-lvl1 :: Integer
-[GblId, Unf=OtherCon []]
-lvl1 = GHC.Num.Integer.IS 11#
+lvl = GHC.Num.Integer.IS 11#
 
 -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
 F9.f1 :: Integer
@@ -18,14 +13,19 @@ F9.f1 :: Integer
 F9.f1 = GHC.Num.Integer.IS 10#
 
 Rec {
--- RHS size: {terms: 15, types: 2, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 28, types: 6, coercions: 0, joins: 0/0}
 F9.f91_f [Occ=LoopBreaker] :: Integer -> Integer
-[GblId, Arity=1, Str=<SL>, Unf=OtherCon []]
+[GblId, Arity=1, Str=<1L>, Unf=OtherCon []]
 F9.f91_f
   = \ (n :: Integer) ->
-      case GHC.Num.Integer.integerLe n lvl of {
-        False -> GHC.Num.Integer.integerSub n F9.f1;
-        True -> F9.f91_f (F9.f91_f (GHC.Num.Integer.integerAdd n lvl1))
+      case n of x1 {
+        GHC.Num.Integer.IS x ->
+          case GHC.Prim.<=# x 100# of {
+            __DEFAULT -> GHC.Num.Integer.integerSub x1 F9.f1;
+            1# -> F9.f91_f (F9.f91_f (GHC.Num.Integer.integerAdd x1 lvl))
+          };
+        GHC.Num.Integer.IP x -> GHC.Num.Integer.integerSub x1 F9.f1;
+        GHC.Num.Integer.IN x -> F9.f91_f (F9.f91_f (GHC.Num.Integer.integerAdd x1 lvl))
       }
 end Rec }
 


=====================================
testsuite/tests/simplCore/should_compile/T18013.stderr
=====================================
@@ -165,9 +165,9 @@ mapMaybeRule [InlPrag=[2]]
                                                              Result s b #)))
                                   s1
                            of
-                           { (# new_s [Occ=Once1], a2 [Occ=Once1!] #) ->
-                           case a2 of { Result t2 [Occ=Once1] c1 [Occ=Once1] ->
-                           (# new_s,
+                           { (# ipv [Occ=Once1], ipv1 [Occ=Once1!] #) ->
+                           case ipv1 of { Result t2 [Occ=Once1] c1 [Occ=Once1] ->
+                           (# ipv,
                               T18013a.Result @s @(Maybe b) t2 (GHC.Internal.Maybe.Just @b c1) #)
                            }
                            }
@@ -207,9 +207,9 @@ mapMaybeRule
                                                   Result s b #)))
                        s1
                 of
-                { (# new_s, a2 #) ->
-                case a2 of { Result t2 c1 ->
-                (# new_s,
+                { (# ipv, ipv1 #) ->
+                case ipv1 of { Result t2 c1 ->
+                (# ipv,
                    T18013a.Result @s @(Maybe b) t2 (GHC.Internal.Maybe.Just @b c1) #)
                 }
                 }


=====================================
testsuite/tests/simplCore/should_compile/T20040.stderr
=====================================
@@ -13,9 +13,10 @@ ifoldl' =
     \r [f z ds]
         case ds of wild {
           Nil -> z;
-          Cons x xs ->
+          Cons ipv2 ipv3 ->
               case z of z1 {
-              __DEFAULT -> case f z1 x of sat { __DEFAULT -> ifoldl' f sat xs; };
+              __DEFAULT ->
+              case f z1 ipv2 of sat { __DEFAULT -> ifoldl' f sat ipv3; };
               };
         };
 end Rec }


=====================================
testsuite/tests/simplStg/should_compile/T15226b.stderr
=====================================
@@ -20,13 +20,13 @@ T15226b.testFun1
 [GblId, Arity=3, Str=<L><ML><L>, Unf=OtherCon []] =
     {} \r [x y void]
         case seq# [x GHC.Prim.void#] of ds1 {
-        (# #) a1 [Occ=Once1] ->
+        (# #) ipv1 [Occ=Once1] ->
         let {
           sat [Occ=Once1] :: T15226b.StrictPair a b
           [LclId] =
-              {a1, y} \u []
+              {ipv1, y} \u []
                   case y of conrep {
-                  __DEFAULT -> T15226b.MkStrictPair [a1 conrep];
+                  __DEFAULT -> T15226b.MkStrictPair [ipv1 conrep];
                   };
         } in  seq# [sat GHC.Prim.void#];
         };



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1fbbc520911b02b6a82e9688527595dc524cf860

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1fbbc520911b02b6a82e9688527595dc524cf860
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240328/441d8c9b/attachment-0001.html>


More information about the ghc-commits mailing list