-
Notifications
You must be signed in to change notification settings - Fork 1
/
GhcLlvmBattle_Config.hs
66 lines (52 loc) · 1.81 KB
/
GhcLlvmBattle_Config.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
module GhcLlvmBattle_Config(
config
)
where
import Fibon.Run.Config
config :: RunConfig
config = RunConfig {
configId = "llvm-battle"
, runList = map RunSingle allBenchmarks
, sizeList = [Ref]
, tuneList = [Base, Peak]
, iterations = 10
, configBuilder = build
}
standardGHC :: FilePath
standardGHC = "/Research/git/ghc/inplace/bin"
build :: ConfigBuilder
build ConfigTuneDefault ConfigBenchDefault = do
setTimeout $ Limit 1 0 0
append ConfigureFlags "--ghc-option=-rtsopts"
collectExtraStatsFrom "ghc.stats"
append RunFlags "+RTS -tghc.stats --machine-readable -RTS"
-- Use ghc from standard location off of HOME
mbHome <- getEnv "HOME"
maybe done
(\h -> useGhcInPlaceDir (h ++ standardGHC))
mbHome
-- Use ghc specified from environment
mbHead <- getEnv "FIBON_GHC"
maybe done
useGhcInPlaceDir
mbHead
append ConfigureFlags "-O2" -- for GHC high-level optimizations
append ConfigureFlags "--ghc-option=-fllvm"
build (ConfigTune Base) ConfigBenchDefault = do
--append ConfigureFlags "--ghc-option=-optlo=-disable-opt"
append ConfigureFlags "--ghc-option=-optlo=-mem2reg"
append ConfigureFlags "--ghc-option=-optlc=-O1"
build (ConfigTune Peak) ConfigBenchDefault = do
append ConfigureFlags "--ghc-option=-optlo=-O2"
append ConfigureFlags "--ghc-option=-optlc=-O2"
build (ConfigTuneDefault) (ConfigBench Cpsa) = do
append BuildFlags "--ghc-option=-fcontext-stack=42"
build (ConfigTuneDefault) (ConfigBench QuickHull) = do
append RunFlags "+RTS -K16M -RTS"
build (ConfigTuneDefault) (ConfigBench BinaryTrees) = do
append RunFlags "+RTS -K32M -RTS"
build (ConfigTuneDefault) (ConfigBench Palindromes) = do
append RunFlags "+RTS -K128M -RTS"
build (ConfigTuneDefault) (ConfigBench TernaryTrees) = do
append RunFlags "+RTS -K16M -RTS"
build _ _ = done