summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2014-10-19 20:37:40 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2014-11-12 11:03:42 +0100
commitc774b28f76ee4c220f7c1c9fd81585e0e3af0e8a (patch)
tree9fc156d8e3c7d8fd414b572826f139c1efa5f34c /testsuite/tests
parentfcfc87dce752c3c1702eeb54d1023213729f1832 (diff)
downloadhaskell-c774b28f76ee4c220f7c1c9fd81585e0e3af0e8a.tar.gz
Implement new integer-gmp2 from scratch (re #9281)
This is done as a separate `integer-gmp2` backend library because it turned out to become a complete rewrite from scratch. Due to the different (over)allocation scheme and potentially different accounting (via the new `{shrink,resize}MutableByteArray#` primitives), some of the nofib benchmarks actually results in increased allocation numbers (but not necessarily an increase in runtime!). I believe the allocation numbers could improve if `{resize,shrink}MutableByteArray#` could be optimised to reallocate in-place more efficiently. Here are the more apparent changes in the latest nofib comparision between `integer-gmp` and `integer-gmp2`: ------------------------------------------------------------------ Program Size Allocs Runtime Elapsed TotalMem ------------------------------------------------------------------ ... bernouilli +1.6% +15.3% 0.132 0.132 0.0% ... cryptarithm1 -2.2% 0.0% -9.7% -9.7% 0.0% ... fasta -0.7% -0.0% +10.9% +10.9% 0.0% ... kahan +0.6% +38.9% 0.169 0.169 0.0% ... lcss -0.7% -0.0% -6.4% -6.4% 0.0% ... mandel +1.6% +33.6% 0.049 0.049 0.0% ... pidigits +0.8% +8.5% +3.9% +3.9% 0.0% power +1.4% -23.8% -18.6% -18.6% -16.7% ... primetest +1.3% +50.1% 0.085 0.085 0.0% ... rsa +1.6% +53.4% 0.026 0.026 0.0% ... scs +1.2% +6.6% +6.5% +6.6% +14.3% ... symalg +1.0% +9.5% 0.010 0.010 0.0% ... transform -0.6% -0.0% -5.9% -5.9% 0.0% ... ------------------------------------------------------------------ Min -2.3% -23.8% -18.6% -18.6% -16.7% Max +1.6% +53.4% +10.9% +10.9% +14.3% Geometric Mean -0.3% +1.9% -0.8% -0.8% +0.0% (see P35 / https://phabricator.haskell.org/P35 for full report) By default, `INTEGER_LIBRARY=integer-gmp2` is active now, which results in the package `integer-gmp-1.0.0.0` being registered in the package db. The previous `integer-gmp-0.5.1.0` can be restored by setting `INTEGER_LIBRARY=integer-gmp` (but will probably be removed altogether for GHC 7.12). In-tree GMP support has been stolen from the old `integer-gmp` (while unpatching the custom memory-allocators, as well as forcing `-fPIC`) A minor hack to `ghc-cabal` was necessary in order to support two different `integer-gmp` packages (in different folders) with the same package key. There will be a couple of follow-up commits re-implementing some features that were dropped to keep D82 minimal, as well as further clean-ups/improvements. More information can be found via #9281 and https://ghc.haskell.org/trac/ghc/wiki/Design/IntegerGmp2 Reviewed By: austin, rwbarton, simonmar Differential Revision: https://phabricator.haskell.org/D82
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/ghci/scripts/ghci025.stdout6
-rw-r--r--testsuite/tests/lib/integer/all.T3
-rw-r--r--testsuite/tests/llvm/should_compile/all.T2
-rw-r--r--testsuite/tests/perf/should_run/all.T3
-rw-r--r--testsuite/tests/perf/space_leaks/all.T6
-rw-r--r--testsuite/tests/safeHaskell/check/pkg01/all.T1
-rw-r--r--testsuite/tests/simplCore/should_run/T5603.hs3
-rw-r--r--testsuite/tests/typecheck/should_fail/T5095.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail072.stderr2
9 files changed, 19 insertions, 11 deletions
diff --git a/testsuite/tests/ghci/scripts/ghci025.stdout b/testsuite/tests/ghci/scripts/ghci025.stdout
index e5654b3734..532a3347cc 100644
--- a/testsuite/tests/ghci/scripts/ghci025.stdout
+++ b/testsuite/tests/ghci/scripts/ghci025.stdout
@@ -56,9 +56,9 @@ Prelude.length ::
Data.Foldable.Foldable t => forall a. t a -> GHC.Types.Int
-- imported via T
data T.Integer
- = integer-gmp-0.5.1.0:GHC.Integer.Type.S# GHC.Prim.Int#
- | integer-gmp-0.5.1.0:GHC.Integer.Type.J# GHC.Prim.Int#
- GHC.Prim.ByteArray#
+ = integer-gmp-1.0.0.0:GHC.Integer.Type.S# !GHC.Prim.Int#
+ | integer-gmp-1.0.0.0:GHC.Integer.Type.Jp# {-# UNPACK #-}integer-gmp-1.0.0.0:GHC.Integer.Type.BigNat
+ | integer-gmp-1.0.0.0:GHC.Integer.Type.Jn# {-# UNPACK #-}integer-gmp-1.0.0.0:GHC.Integer.Type.BigNat
T.length :: Data.ByteString.Internal.ByteString -> GHC.Types.Int
:browse! T
-- defined locally
diff --git a/testsuite/tests/lib/integer/all.T b/testsuite/tests/lib/integer/all.T
index 7b5e5f2dbe..55154265fc 100644
--- a/testsuite/tests/lib/integer/all.T
+++ b/testsuite/tests/lib/integer/all.T
@@ -1,7 +1,8 @@
test('integerBits', normal, compile_and_run, [''])
test('integerConversions', normal, compile_and_run, [''])
+## 'integerGmpInternals' disabled till the extra primitives are re-implemented
# skip ghci as it doesn't support unboxed tuples
-test('integerGmpInternals', [reqlib('integer-gmp'), omit_ways('ghci')], compile_and_run, [''])
+# test('integerGmpInternals', [reqlib('integer-gmp'), omit_ways('ghci')], compile_and_run, [''])
test('integerConstantFolding',
[ extra_clean(['integerConstantFolding.simpl'])
, when(compiler_debugged(), expect_broken(8525))],
diff --git a/testsuite/tests/llvm/should_compile/all.T b/testsuite/tests/llvm/should_compile/all.T
index e9154196f0..b630645f1e 100644
--- a/testsuite/tests/llvm/should_compile/all.T
+++ b/testsuite/tests/llvm/should_compile/all.T
@@ -7,7 +7,7 @@ setTestOpts(f)
test('T5054', reqlib('hmatrix'), compile, ['-package hmatrix'])
test('T5054_2', reqlib('hmatrix'), compile, ['-package hmatrix'])
-test('T5486', reqlib('integer-gmp'), compile, [''])
+# test('T5486', reqlib('integer-gmp'), compile, [''])
test('T5681', normal, compile, [''])
test('T6158', [reqlib('vector'), reqlib('primitive')], compile, ['-package vector -package primitive'])
test('T7571', cmm_src, compile, [''])
diff --git a/testsuite/tests/perf/should_run/all.T b/testsuite/tests/perf/should_run/all.T
index 749e8aefe6..d8af52bbef 100644
--- a/testsuite/tests/perf/should_run/all.T
+++ b/testsuite/tests/perf/should_run/all.T
@@ -169,8 +169,9 @@ test('T5549',
[stats_num_field('bytes allocated',
[(wordsize(32), 3362958676, 5),
# expected value: 3362958676 (Windows)
- (wordsize(64), 6725846120, 5)]),
+ (wordsize(64), 8193140752, 5)]),
# expected value: 6725846120 (amd64/Linux)
+ # 8193140752 (amd64/Linux) integer-gmp2
only_ways(['normal'])
],
compile_and_run,
diff --git a/testsuite/tests/perf/space_leaks/all.T b/testsuite/tests/perf/space_leaks/all.T
index ac60c8fa58..af7eefccc5 100644
--- a/testsuite/tests/perf/space_leaks/all.T
+++ b/testsuite/tests/perf/space_leaks/all.T
@@ -4,7 +4,8 @@ test('space_leak_001',
# Now it's: 3 (amd64/Linux)
# 4 (x86/OS X)
# 5 (x86/Linux)
- [stats_num_field('peak_megabytes_allocated', (4, 1)),
+ [stats_num_field('peak_megabytes_allocated', (3, 1)),
+ # 3 (amd64/Linux, integer-gmp2)
stats_num_field('max_bytes_used',
[(wordsize(64), 440000, 15),
# 440224 (amd64/Linux)
@@ -14,11 +15,12 @@ test('space_leak_001',
(wordsize(32), 405650, 10)]),
# 2013-02-10 372072 (x86/OSX)
# 2013-02-10 439228 (x86/OSX)
- stats_num_field('bytes allocated', (9079316016, 1)),
+ stats_num_field('bytes allocated', (11315747416, 1)),
# expected value: 9079316016 (amd64/Linux)
# 9331570416 (x86/Linux)
# 9329073952 (x86/OS X)
# 9327959840 (x86/Windows)
+ # 11315747416 (amd64/Lnx, integer-gmp2)
omit_ways(['profasm','profthreaded','threaded1','threaded2'])
],
compile_and_run,
diff --git a/testsuite/tests/safeHaskell/check/pkg01/all.T b/testsuite/tests/safeHaskell/check/pkg01/all.T
index 604a5cc777..f121b99add 100644
--- a/testsuite/tests/safeHaskell/check/pkg01/all.T
+++ b/testsuite/tests/safeHaskell/check/pkg01/all.T
@@ -40,6 +40,7 @@ test('safePkg01',
normalise_errmsg_fun(ignoreLdOutput),
normalise_fun(
normaliseArrayPackage,
+ normaliseIntegerPackage,
normaliseBytestringPackage)],
run_command,
['$MAKE -s --no-print-directory safePkg01 ' + make_args])
diff --git a/testsuite/tests/simplCore/should_run/T5603.hs b/testsuite/tests/simplCore/should_run/T5603.hs
index 635de33d6a..c1545d2c39 100644
--- a/testsuite/tests/simplCore/should_run/T5603.hs
+++ b/testsuite/tests/simplCore/should_run/T5603.hs
@@ -12,4 +12,5 @@ main = (encodeDouble 0 :: Double) `seq` return ()
{-# INLINE encodeDouble #-}
encodeDouble :: Integer -> Double
encodeDouble (S# _) = D# 3.0##
-encodeDouble (J# _ _) = D# 4.0##
+encodeDouble (Jp# _) = D# 4.0##
+encodeDouble (Jn# _) = D# 5.0##
diff --git a/testsuite/tests/typecheck/should_fail/T5095.stderr b/testsuite/tests/typecheck/should_fail/T5095.stderr
index 82613e64d9..701bd761d3 100644
--- a/testsuite/tests/typecheck/should_fail/T5095.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5095.stderr
@@ -56,8 +56,10 @@ T5095.hs:9:11:
instance Eq Ordering -- Defined in ‘GHC.Classes’
instance Eq Word -- Defined in ‘GHC.Classes’
instance Eq a => Eq [a] -- Defined in ‘GHC.Classes’
+ instance Eq integer-gmp-1.0.0.0:GHC.Integer.Type.BigNat
+ -- Defined in ‘integer-gmp-1.0.0.0:GHC.Integer.Type’
instance Eq Integer
- -- Defined in ‘integer-gmp-0.5.1.0:GHC.Integer.Type’
+ -- Defined in ‘integer-gmp-1.0.0.0:GHC.Integer.Type’
(The choice depends on the instantiation of ‘a’
To pick the first instance above, use IncoherentInstances
when compiling the other instance declarations)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail072.stderr b/testsuite/tests/typecheck/should_fail/tcfail072.stderr
index d5eb4aa87f..c9b1d10b2b 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail072.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail072.stderr
@@ -10,6 +10,6 @@ tcfail072.hs:23:13:
instance Ord a => Ord (Maybe a) -- Defined in ‘GHC.Base’
instance Ord () -- Defined in ‘GHC.Classes’
instance (Ord a, Ord b) => Ord (a, b) -- Defined in ‘GHC.Classes’
- ...plus 22 others
+ ...plus 23 others
In the expression: g A
In an equation for ‘g’: g (B _ _) = g A