Extract hard-coded LLVM opt flags into a file
authorKavon Farvardin <kavon@farvard.in>
Sun, 27 May 2018 15:49:25 +0000 (11:49 -0400)
committerBen Gamari <ben@smart-cactus.org>
Wed, 30 May 2018 14:02:10 +0000 (10:02 -0400)
commita4ae199cf810a63444a4ef24a44b33329023cd93
tree8ecbb42f89140f02ac808b72737a1a735f478461
parent9aac442f70b0b58decd56fb52dd4ec2289b03759
Extract hard-coded LLVM opt flags into a file

To resolve ticket #11295, I think it makes sense to stop hard-coding
the pass sequences used by GHC when compiling with LLVM into the
compiler
itself.

This patchset introduces a companion to the existing `llvm-targets` file
called `llvm-passes`. The passes file is a simple association list that
holds the default LLVM `opt` pass sequence used by GHC. This allows end
users to easily save their favorite optimization flags when compiling
with LLVM.

The main benefit for ticket #11295 is that when adding a custom pass
sequence, it tends to be an extremely long string that would be
unsightly in the code.

This is essentially part 1 of 2 for ticket #11295.

Test Plan: ./validate

Reviewers: bgamari, angerman

Reviewed By: angerman

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4695
compiler/main/DriverPipeline.hs
compiler/main/DynFlags.hs
compiler/main/GHC.hs
compiler/main/SysTools.hs
ghc.mk
ghc/GHCi/UI.hs
ghc/ghc.mk
llvm-passes [new file with mode: 0644]