[Git][ghc/ghc][wip/T21623] Wibbles

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Wed Sep 28 14:07:52 UTC 2022



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


Commits:
d594e3aa by Simon Peyton Jones at 2022-09-28T15:09:43+01:00
Wibbles

- - - - -


1 changed file:

- compiler/GHC/Core/Opt/ConstantFold.hs


Changes:

=====================================
compiler/GHC/Core/Opt/ConstantFold.hs
=====================================
@@ -46,7 +46,7 @@ import GHC.Core
 import GHC.Core.Make
 import GHC.Core.SimpleOpt (  exprIsConApp_maybe, exprIsLiteral_maybe )
 import GHC.Core.DataCon ( DataCon,dataConTagZ, dataConTyCon, dataConWrapId, dataConWorkId )
-import GHC.Core.Utils  ( cheapEqExpr, exprIsHNF, exprType
+import GHC.Core.Utils  ( cheapEqExpr, exprIsHNF
                        , stripTicksTop, stripTicksTopT, mkTicks )
 import GHC.Core.Multiplicity
 import GHC.Core.Rules.Config
@@ -1000,7 +1000,6 @@ retLit l = do platform <- getPlatform
 retLitNoC :: (Platform -> Literal) -> RuleM CoreExpr
 retLitNoC l = do platform <- getPlatform
                  let lit = l platform
-                 let ty = literalType lit
                  return $ mkCoreUnboxedTuple [Lit lit, Lit (zeroi platform)]
 
 word8Op2
@@ -1116,11 +1115,10 @@ doubleDecodeOp env (LitDouble ((decodeFloat . fromRational @Double) -> (m, e)))
                               , mkIntVal platform (toInteger e) ]
   where
     platform = roPlatform env
-    (iNT64Ty, mkLitINT64)
-      | platformWordSizeInBits platform < 64
-      = (int64PrimTy, mkLitInt64Wrap)
-      | otherwise
-      = (intPrimTy  , mkLitIntWrap platform)
+    mkLitINT64 | platformWordSizeInBits platform < 64
+               = mkLitInt64Wrap
+               | otherwise
+               = mkLitIntWrap platform
 doubleDecodeOp _   _
   = Nothing
 
@@ -1953,7 +1951,7 @@ Implementing seq#.  The compiler has magic for SeqOp in
 
 seqRule :: RuleM CoreExpr
 seqRule = do
-  [Type ty_a, Type _ty_s, a, s] <- getArgs
+  [Type _ty_a, Type _ty_s, a, s] <- getArgs
   guard $ exprIsHNF a
   return $ mkCoreUnboxedTuple [s, a]
 
@@ -2133,12 +2131,12 @@ builtinBignumRules =
   , divop_one  "integerRem"     integerRemName     rem     mkIntegerExpr
   , divop_one  "integerDiv"     integerDivName     div     mkIntegerExpr
   , divop_one  "integerMod"     integerModName     mod     mkIntegerExpr
-  , divop_both "integerDivMod"  integerDivModName  divMod  mkIntegerExpr integerTy
-  , divop_both "integerQuotRem" integerQuotRemName quotRem mkIntegerExpr integerTy
+  , divop_both "integerDivMod"  integerDivModName  divMod  mkIntegerExpr
+  , divop_both "integerQuotRem" integerQuotRemName quotRem mkIntegerExpr
 
   , divop_one  "naturalQuot"    naturalQuotName    quot    mkNaturalExpr
   , divop_one  "naturalRem"     naturalRemName     rem     mkNaturalExpr
-  , divop_both "naturalQuotRem" naturalQuotRemName quotRem mkNaturalExpr naturalTy
+  , divop_both "naturalQuotRem" naturalQuotRemName quotRem mkNaturalExpr
 
     -- conversions from Rational for Float/Double literals
   , rational_to "rationalToFloat"  rationalToFloatName  mkFloatExpr
@@ -2288,7 +2286,7 @@ builtinBignumRules =
       platform <- getPlatform
       pure $ mk_lit platform (n `divop` d)
 
-    divop_both str name divop mk_lit ty = mkRule str name 2 $ do
+    divop_both str name divop mk_lit = mkRule str name 2 $ do
       [a0,a1] <- getArgs
       n <- isBignumLiteral a0
       d <- isBignumLiteral a1



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d594e3aa7cf990e2ca4aecad1afe2c795694905a
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/20220928/170ad0bb/attachment-0001.html>


More information about the ghc-commits mailing list