Clean up opt and llc
authorMoritz Angermann <moritz.angermann@gmail.com>
Wed, 6 Sep 2017 15:31:01 +0000 (11:31 -0400)
committerBen Gamari <ben@smart-cactus.org>
Wed, 6 Sep 2017 15:33:07 +0000 (11:33 -0400)
commit22733532171330136d87533d523f565f2a4f102f
treed399f168096fe203d459fb5fa0fc1210ff05bd4c
parent0cd467b2269595e1ae2bc273c3acf9e14adeb9e7
Clean up opt and llc

The LLVM backend shells out to LLVMs `opt` and `llc` tools. This clean
up introduces a shared data structure to carry the arguments we pass to
each tool so that corresponding flags are next to each other. It drops
the hard coded data layouts in favor of using `-mtriple` and have LLVM
infer them. Furthermore we add `clang` as a proper tool, so we don't
rely on assuming that `clang` is called `clang` on the `PATH` when using
`clang` as the assembler.  Finally this diff also changes the type of
`optLevel` from `Int` to `Word`, as we do not have negative optimization
levels.

Reviewers: erikd, hvr, austin, rwbarton, bgamari, kavon

Reviewed By: kavon

Subscribers: michalt, Ericson2314, ryantrinkle, dfeuer, carter, simonpj,
kavon, simonmar, thomie, erikd, snowleopard

Differential Revision: https://phabricator.haskell.org/D3352
18 files changed:
aclocal.m4
compiler/llvmGen/LlvmCodeGen.hs
compiler/llvmGen/LlvmCodeGen/Ppr.hs
compiler/main/DriverPipeline.hs
compiler/main/DynFlags.hs
compiler/main/GHC.hs
compiler/main/SysTools.hs
compiler/nativeGen/RegAlloc/Linear/Main.hs
configure.ac
ghc.mk
ghc/GHCi/UI.hs
ghc/ghc.mk
llvm-targets [new file with mode: 0644]
mk/config.mk.in
settings.in
testsuite/mk/ghc-config.hs
testsuite/tests/perf/compiler/all.T
utils/llvm-targets/gen-data-layout.sh [new file with mode: 0755]