[commit: ghc] wip/hadrian-bench: Add a bench flavour to Hadrian (0ac7b9f)
git at git.haskell.org
git at git.haskell.org
Fri Mar 15 19:06:59 UTC 2019
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/hadrian-bench
Link : http://ghc.haskell.org/trac/ghc/changeset/0ac7b9fa230cfc919dde0adb6b9ffe1631331219/ghc
>---------------------------------------------------------------
commit 0ac7b9fa230cfc919dde0adb6b9ffe1631331219
Author: Sebastian Graf <sebastian.graf at kit.edu>
Date: Fri Mar 15 17:06:21 2019 +0100
Add a bench flavour to Hadrian
>---------------------------------------------------------------
0ac7b9fa230cfc919dde0adb6b9ffe1631331219
hadrian/hadrian.cabal | 1 +
hadrian/src/Settings.hs | 7 ++++---
hadrian/src/Settings/Flavours/Benchmark.hs | 23 +++++++++++++++++++++++
hadrian/src/Settings/Flavours/Llvm.hs | 5 ++++-
4 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal
index a5a1ead..2c54382 100644
--- a/hadrian/hadrian.cabal
+++ b/hadrian/hadrian.cabal
@@ -89,6 +89,7 @@ executable hadrian
, Settings.Builders.RunTest
, Settings.Builders.Xelatex
, Settings.Default
+ , Settings.Flavours.Benchmark
, Settings.Flavours.Common
, Settings.Flavours.Development
, Settings.Flavours.Llvm
diff --git a/hadrian/src/Settings.hs b/hadrian/src/Settings.hs
index bc0f8ce..ef88ef4 100755
--- a/hadrian/src/Settings.hs
+++ b/hadrian/src/Settings.hs
@@ -11,6 +11,7 @@ import Packages
import UserSettings (userFlavours, userPackages, userDefaultFlavour)
import {-# SOURCE #-} Settings.Default
+import Settings.Flavours.Benchmark
import Settings.Flavours.Development
import Settings.Flavours.Llvm
import Settings.Flavours.Performance
@@ -35,9 +36,9 @@ stagePackages stage = do
hadrianFlavours :: [Flavour]
hadrianFlavours =
- [ defaultFlavour, developmentFlavour Stage1, developmentFlavour Stage2
- , performanceFlavour, profiledFlavour, quickFlavour, quickestFlavour
- , quickCrossFlavour
+ [ benchmarkFlavour, defaultFlavour, developmentFlavour Stage1
+ , developmentFlavour Stage2, performanceFlavour, profiledFlavour
+ , quickFlavour, quickestFlavour, quickCrossFlavour, benchmarkLlvmFlavour
, performanceLlvmFlavour, profiledLlvmFlavour, quickLlvmFlavour ]
flavour :: Action Flavour
diff --git a/hadrian/src/Settings/Flavours/Benchmark.hs b/hadrian/src/Settings/Flavours/Benchmark.hs
new file mode 100644
index 0000000..46a4a18
--- /dev/null
+++ b/hadrian/src/Settings/Flavours/Benchmark.hs
@@ -0,0 +1,23 @@
+module Settings.Flavours.Benchmark (benchmarkFlavour) where
+
+import Expression
+import Flavour
+import {-# SOURCE #-} Settings.Default
+
+-- Please update doc/flavours.md when changing this file.
+benchmarkFlavour :: Flavour
+benchmarkFlavour = defaultFlavour
+ { name = "bench"
+ , args = defaultBuilderArgs <> benchmarkArgs <> defaultPackageArgs
+ , libraryWays = pure [vanilla]
+ , rtsWays = pure [vanilla, threaded] }
+
+benchmarkArgs :: Args
+benchmarkArgs = sourceArgs SourceArgs
+ { hsDefault = pure ["-O", "-H64m"]
+ , hsLibrary = pure ["-O2"]
+ -- TODO: We should really pass -O2 when notStage0. Otherwise, we aren't
+ -- really measuring the overhead of a potential new optimisation we want
+ -- to benchmark. This has to happen in sync with the Makefile build, though.
+ , hsCompiler = mconcat [stage0 ? arg "-O2", notStage0 ? arg "-O0"]
+ , hsGhc = pure ["-O2"] }
\ No newline at end of file
diff --git a/hadrian/src/Settings/Flavours/Llvm.hs b/hadrian/src/Settings/Flavours/Llvm.hs
index 2752c9e..ddf07a2 100644
--- a/hadrian/src/Settings/Flavours/Llvm.hs
+++ b/hadrian/src/Settings/Flavours/Llvm.hs
@@ -1,4 +1,5 @@
module Settings.Flavours.Llvm (
+ benchmarkLlvmFlavour,
performanceLlvmFlavour,
profiledLlvmFlavour,
quickLlvmFlavour,
@@ -7,12 +8,14 @@ module Settings.Flavours.Llvm (
import Expression
import Flavour
+import Settings.Flavours.Benchmark
import Settings.Flavours.Performance
import Settings.Flavours.Profiled
import Settings.Flavours.Quick
-- Please update doc/flavours.md when changing this file.
-performanceLlvmFlavour, profiledLlvmFlavour, quickLlvmFlavour :: Flavour
+benchmarkLlvmFlavour, performanceLlvmFlavour, profiledLlvmFlavour, quickLlvmFlavour :: Flavour
+benchmarkLlvmFlavour = mkLlvmFlavour benchmarkFlavour
performanceLlvmFlavour = mkLlvmFlavour performanceFlavour
profiledLlvmFlavour = mkLlvmFlavour profiledFlavour
quickLlvmFlavour = mkLlvmFlavour quickFlavour
More information about the ghc-commits
mailing list