summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2021-03-05 15:14:25 +0800
committerViktor Dukhovni <ietf-dane@dukhovni.org>2021-04-10 13:17:12 -0400
commit2d3372d5f24018f223e61c326c5404d508d31ae8 (patch)
tree7bc80e37d2355ebf598364950d8961bb0ef20cee
parent2946f2eb07e47afcfe5876e091ad4dc8c567abcf (diff)
downloadhaskell-2d3372d5f24018f223e61c326c5404d508d31ae8.tar.gz
[base] inline mconcat
partial backport of !4890 Forward-ported from 8.10 to 9.2 with the addition of a rationale comment suggested and requested by spj. The rather wobbly T9198 seems to be showing a metric decrease here. Changing its margin to 10% from 2%, but just in case also noting a potential metric decrease (obserbed in previous runs). See also #19668. Metric Decrease: T9198
-rw-r--r--libraries/base/GHC/Base.hs2
-rw-r--r--testsuite/tests/perf/compiler/all.T2
2 files changed, 3 insertions, 1 deletions
diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs
index 7d5023650d..9f4b0e9d0c 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -291,6 +291,8 @@ class Semigroup a => Monoid a where
-- "Hello Haskell!"
mconcat :: [a] -> a
mconcat = foldr mappend mempty
+ {-# INLINE mconcat #-}
+ -- INLINE in the hope of fusion with mconcat's argument (see !4890)
-- | @since 4.9.0.0
instance Semigroup [a] where
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T
index 937858c2a7..23e028a204 100644
--- a/testsuite/tests/perf/compiler/all.T
+++ b/testsuite/tests/perf/compiler/all.T
@@ -449,6 +449,6 @@ test ('T16577',
compile,
['-v0 -O'])
test ('T9198',
- [ collect_compiler_stats('bytes allocated',2) ],
+ [ collect_compiler_stats('bytes allocated',10) ],
compile,
[''])