diff options
author | Kavon Farvardin <kavon@farvard.in> | 2018-05-27 11:49:25 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-05-30 10:02:10 -0400 |
commit | a4ae199cf810a63444a4ef24a44b33329023cd93 (patch) | |
tree | 8ecbb42f89140f02ac808b72737a1a735f478461 /llvm-passes | |
parent | 9aac442f70b0b58decd56fb52dd4ec2289b03759 (diff) | |
download | haskell-a4ae199cf810a63444a4ef24a44b33329023cd93.tar.gz |
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
Diffstat (limited to 'llvm-passes')
-rw-r--r-- | llvm-passes | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm-passes b/llvm-passes new file mode 100644 index 0000000000..5183c9f2ab --- /dev/null +++ b/llvm-passes @@ -0,0 +1,5 @@ +[ +(0, "-mem2reg -globalopt"), +(1, "-O1 -globalopt"), +(2, "-O2") +] |