summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-10-07 11:48:07 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-20 17:49:07 -0400
commita901a1ae6709b8e241cb93a9013b41f48fe3ecca (patch)
tree3528674ee06e97a252b5c3be925a56934705b00d
parent758e0d7bbe517b67fb20c3fb591e76b65b2959af (diff)
downloadhaskell-a901a1ae6709b8e241cb93a9013b41f48fe3ecca.tar.gz
Bignum: allow Integer's signum to inline (#20361)
Allow T12545 to increase because it only happens on CI with dwarf enabled and probably not related to this patch. Metric Increase: T12545
-rw-r--r--compiler/GHC/Builtin/Names.hs5
-rw-r--r--compiler/GHC/Core/Opt/ConstantFold.hs1
-rw-r--r--libraries/ghc-bignum/src/GHC/Num/Integer.hs2
3 files changed, 0 insertions, 8 deletions
diff --git a/compiler/GHC/Builtin/Names.hs b/compiler/GHC/Builtin/Names.hs
index 2c07acdf4e..5b6f032bc5 100644
--- a/compiler/GHC/Builtin/Names.hs
+++ b/compiler/GHC/Builtin/Names.hs
@@ -368,7 +368,6 @@ basicKnownKeyNames
integerSubName,
integerNegateName,
integerAbsName,
- integerSignumName,
integerPopCountName,
integerQuotName,
integerRemName,
@@ -1151,7 +1150,6 @@ integerFromNaturalName
, integerSubName
, integerNegateName
, integerAbsName
- , integerSignumName
, integerPopCountName
, integerQuotName
, integerRemName
@@ -1255,7 +1253,6 @@ integerMulName = bniVarQual "integerMul" integerMulIdK
integerSubName = bniVarQual "integerSub" integerSubIdKey
integerNegateName = bniVarQual "integerNegate" integerNegateIdKey
integerAbsName = bniVarQual "integerAbs" integerAbsIdKey
-integerSignumName = bniVarQual "integerSignum" integerSignumIdKey
integerPopCountName = bniVarQual "integerPopCount#" integerPopCountIdKey
integerQuotName = bniVarQual "integerQuot" integerQuotIdKey
integerRemName = bniVarQual "integerRem" integerRemIdKey
@@ -2522,7 +2519,6 @@ integerFromNaturalIdKey
, integerSubIdKey
, integerNegateIdKey
, integerAbsIdKey
- , integerSignumIdKey
, integerPopCountIdKey
, integerQuotIdKey
, integerRemIdKey
@@ -2589,7 +2585,6 @@ integerMulIdKey = mkPreludeMiscIdUnique 609
integerSubIdKey = mkPreludeMiscIdUnique 610
integerNegateIdKey = mkPreludeMiscIdUnique 611
integerAbsIdKey = mkPreludeMiscIdUnique 618
-integerSignumIdKey = mkPreludeMiscIdUnique 619
integerPopCountIdKey = mkPreludeMiscIdUnique 621
integerQuotIdKey = mkPreludeMiscIdUnique 622
integerRemIdKey = mkPreludeMiscIdUnique 623
diff --git a/compiler/GHC/Core/Opt/ConstantFold.hs b/compiler/GHC/Core/Opt/ConstantFold.hs
index 9d052748d0..85327c56a4 100644
--- a/compiler/GHC/Core/Opt/ConstantFold.hs
+++ b/compiler/GHC/Core/Opt/ConstantFold.hs
@@ -2097,7 +2097,6 @@ builtinBignumRules =
-- unary operations
, bignum_unop "integerNegate" integerNegateName mkIntegerExpr negate
, bignum_unop "integerAbs" integerAbsName mkIntegerExpr abs
- , bignum_unop "integerSignum" integerSignumName mkIntegerExpr signum
, bignum_unop "integerComplement" integerComplementName mkIntegerExpr complement
, bignum_popcount "integerPopCount" integerPopCountName mkLitIntWrap
diff --git a/libraries/ghc-bignum/src/GHC/Num/Integer.hs b/libraries/ghc-bignum/src/GHC/Num/Integer.hs
index 2f9a5432cf..2c8da3dcc6 100644
--- a/libraries/ghc-bignum/src/GHC/Num/Integer.hs
+++ b/libraries/ghc-bignum/src/GHC/Num/Integer.hs
@@ -514,13 +514,11 @@ integerAbs n@(IS i)
-- | Return @-1@, @0@, and @1@ depending on whether argument is
-- negative, zero, or positive, respectively
integerSignum :: Integer -> Integer
-{-# NOINLINE integerSignum #-}
integerSignum !j = IS (integerSignum# j)
-- | Return @-1#@, @0#@, and @1#@ depending on whether argument is
-- negative, zero, or positive, respectively
integerSignum# :: Integer -> Int#
-{-# NOINLINE integerSignum# #-}
integerSignum# (IN _) = -1#
integerSignum# (IS i#) = sgnI# i#
integerSignum# (IP _ ) = 1#