diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2019-01-29 18:33:20 -0800 |
---|---|---|
committer | Alec Theriault <alec.theriault@gmail.com> | 2019-02-10 09:02:24 -0500 |
commit | b1662e812c09b8b7c41b90415eecb0c7f215a09b (patch) | |
tree | 351a80e4317d027d4a8361082c53477e364e96c3 | |
parent | 07f5cbc8cc61436cd5f3e9280191bad5480203c5 (diff) | |
download | haskell-b1662e812c09b8b7c41b90415eecb0c7f215a09b.tar.gz |
Hadrian: add LLVM flavours
This adds a handful of LLVM flavours and the accompanying
documentation. These flavours are mostly uninteresting, but
exist in the Make system.
-rw-r--r-- | hadrian/doc/flavours.md | 37 | ||||
-rw-r--r-- | hadrian/hadrian.cabal | 1 | ||||
-rwxr-xr-x | hadrian/src/Settings.hs | 4 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/Llvm.hs | 26 |
4 files changed, 65 insertions, 3 deletions
diff --git a/hadrian/doc/flavours.md b/hadrian/doc/flavours.md index cb864a0a99..7b89637f79 100644 --- a/hadrian/doc/flavours.md +++ b/hadrian/doc/flavours.md @@ -109,6 +109,39 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH <td></td> <td>-O0<br>-DDEBUG</td> </tr> + <tr> + <th>quick-llvm</td> + <td>-O0<br>-H64m<br>-fllvm</td> + <td>-O0<br>-H64m<br>-fllvm</td> + <td></td> + <td>-O</td> + <td>-O</td> + <td></td> + <td>-O</td> + <td></td> + </tr> + <tr> + <th>perf-llvm</td> + <td>-O<br>-H64m<br>-fllvm</td> + <td>-O<br>-H64m<br>-fllvm</td> + <td></td> + <td>-O2</td> + <td>-O</td> + <td>-O2</td> + <td>-O</td> + <td>-O2</td> + </tr> + <tr> + <th>prof-llvm</td> + <td>-O0<br>-H64m<br>-fllvm</td> + <td>-O0<br>-H64m<br>-fllvm</td> + <td></td> + <td>-O</td> + <td>-O</td> + <td>-O</td> + <td>-O</td> + <td>-O</td> + </tr> </table> ## Ways @@ -132,7 +165,7 @@ information. The following table lists ways that are built in different flavours <th>stage1+</th> </tr> <tr> - <th>default<br>perf<br>prof<br>devel1<br>devel2</td> + <th>default<br>perf<br>prof<br>devel1<br>devel2<br>perf-llvm<br>prof-llvm</td> <td>vanilla</td> <td>vanilla<br>profiling<br>dynamic</td> <td>logging<br>debug<br>threaded<br>threadedDebug<br>threadedLogging @@ -149,7 +182,7 @@ information. The following table lists ways that are built in different flavours <td>Only in<br>prof<br>flavour</td> </tr> <tr> - <th>quick</th> + <th>quick<br>quick-llvm</th> <td>vanilla</td> <td>vanilla<br>dynamic</td> <td>logging<br>debug<br>threaded<br>threadedDebug<br>threadedLogging diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal index 669d16c776..6a4fff1321 100644 --- a/hadrian/hadrian.cabal +++ b/hadrian/hadrian.cabal @@ -91,6 +91,7 @@ executable hadrian , Settings.Default , Settings.Flavours.Common , Settings.Flavours.Development + , Settings.Flavours.Llvm , Settings.Flavours.Performance , Settings.Flavours.Profiled , Settings.Flavours.Quick diff --git a/hadrian/src/Settings.hs b/hadrian/src/Settings.hs index 99a58db71f..519d1fc80c 100755 --- a/hadrian/src/Settings.hs +++ b/hadrian/src/Settings.hs @@ -12,6 +12,7 @@ import UserSettings (userFlavours, userPackages, userDefaultFlavour) import {-# SOURCE #-} Settings.Default import Settings.Flavours.Development +import Settings.Flavours.Llvm import Settings.Flavours.Performance import Settings.Flavours.Profiled import Settings.Flavours.Quick @@ -36,7 +37,8 @@ hadrianFlavours :: [Flavour] hadrianFlavours = [ defaultFlavour, developmentFlavour Stage1, developmentFlavour Stage2 , performanceFlavour, profiledFlavour, quickFlavour, quickestFlavour - , quickCrossFlavour ] + , quickCrossFlavour + , performanceLlvmFlavour, profiledLlvmFlavour, quickLlvmFlavour ] flavour :: Action Flavour flavour = do diff --git a/hadrian/src/Settings/Flavours/Llvm.hs b/hadrian/src/Settings/Flavours/Llvm.hs new file mode 100644 index 0000000000..2752c9e7c6 --- /dev/null +++ b/hadrian/src/Settings/Flavours/Llvm.hs @@ -0,0 +1,26 @@ +module Settings.Flavours.Llvm ( + performanceLlvmFlavour, + profiledLlvmFlavour, + quickLlvmFlavour, +) where + +import Expression +import Flavour + +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 +performanceLlvmFlavour = mkLlvmFlavour performanceFlavour +profiledLlvmFlavour = mkLlvmFlavour profiledFlavour +quickLlvmFlavour = mkLlvmFlavour quickFlavour + +-- | Turn a flavour into an LLVM flavour +mkLlvmFlavour :: Flavour -> Flavour +mkLlvmFlavour flav = flav + { name = name flav ++ "-llvm" + , args = mconcat [ args flav + , builder Ghc ? arg "-fllvm" ] + } |