integer-gmp's GHC.Integer.Types.decodeDoubleInteger should be inlined
This function
decodeDoubleInteger :: Double# -> (# Integer, Int# #)
-- just the 64 bit branch
decodeDoubleInteger x = case decodeDouble_Int64# x of
(# m#, e# #) -> (# S# m#, e# #)
is marked CONSTANT_FOLDED
(which is an alias for NOINLINE
) currently. But if constant folding fails, we end up with actual calls to those functions, and each of them has to allocate an Integer
box.
Instead, we should inline decodeDoubleInteger
and match on decodeDouble_Int64#
in GHC.Core.Op.ConstantFold
instead.
This will break constant folding for integer-simple
, but according to @hsyl20 here that's not an issue.