summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-09-14 16:59:18 -0400
committerBen Gamari <ben@smart-cactus.org>2022-12-21 16:18:59 -0500
commit30694951430f25f8b02deadc557e689f3e93cc07 (patch)
treedcb2297828604725d365d89159e22b6eadaf15f0
parent3d55d8ab51ece43c51055c43c9e7aba77cce46c0 (diff)
downloadhaskell-wip/bump-llvm.tar.gz
llvmGen: Adapt to allow LLVM 15wip/bump-llvm
We now must use `-passes` in place of `-O<n>` due to #21936. Closes #21936.
-rw-r--r--compiler/GHC/Driver/Flags.hs2
-rw-r--r--compiler/GHC/Driver/Pipeline/Execute.hs3
-rw-r--r--compiler/GHC/Driver/Session.hs2
-rw-r--r--configure.ac2
-rw-r--r--llvm-passes6
5 files changed, 5 insertions, 10 deletions
diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs
index f45397d887..0559b2f64f 100644
--- a/compiler/GHC/Driver/Flags.hs
+++ b/compiler/GHC/Driver/Flags.hs
@@ -264,7 +264,6 @@ data GeneralFlag
| Opt_RegsGraph -- do graph coloring register allocation
| Opt_RegsIterative -- do iterative coalescing graph coloring register allocation
| Opt_PedanticBottoms -- Be picky about how we treat bottom
- | Opt_LlvmTBAA -- Use LLVM TBAA infrastructure for improving AA (hidden flag)
| Opt_LlvmFillUndefWithGarbage -- Testing for undef bugs (hidden flag)
| Opt_IrrefutableTuples
| Opt_CmmSink
@@ -504,7 +503,6 @@ optimisationFlags = EnumSet.fromList
, Opt_RegsGraph
, Opt_RegsIterative
, Opt_PedanticBottoms
- , Opt_LlvmTBAA
, Opt_LlvmFillUndefWithGarbage
, Opt_IrrefutableTuples
, Opt_CmmSink
diff --git a/compiler/GHC/Driver/Pipeline/Execute.hs b/compiler/GHC/Driver/Pipeline/Execute.hs
index 30bd0531a0..1c21648210 100644
--- a/compiler/GHC/Driver/Pipeline/Execute.hs
+++ b/compiler/GHC/Driver/Pipeline/Execute.hs
@@ -977,8 +977,7 @@ llvmOptions :: LlvmConfig
-> DynFlags
-> [(String, String)] -- ^ pairs of (opt, llc) arguments
llvmOptions llvm_config dflags =
- [("-enable-tbaa -tbaa", "-enable-tbaa") | gopt Opt_LlvmTBAA dflags ]
- ++ [("-relocation-model=" ++ rmodel
+ [("-relocation-model=" ++ rmodel
,"-relocation-model=" ++ rmodel) | not (null rmodel)]
++ [("-stack-alignment=" ++ (show align)
,"-stack-alignment=" ++ (show align)) | align > 0 ]
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index 831267e2bf..41045b7936 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -3437,7 +3437,6 @@ fFlagsDeps = [
flagSpec "late-dmd-anal" Opt_LateDmdAnal,
flagSpec "late-specialise" Opt_LateSpecialise,
flagSpec "liberate-case" Opt_LiberateCase,
- flagHiddenSpec "llvm-tbaa" Opt_LlvmTBAA,
flagHiddenSpec "llvm-fill-undef-with-garbage" Opt_LlvmFillUndefWithGarbage,
flagSpec "loopification" Opt_Loopification,
flagSpec "block-layout-cfg" Opt_CfgBlocklayout,
@@ -3988,7 +3987,6 @@ optLevelFlags :: [([Int], GeneralFlag)]
optLevelFlags -- see Note [Documenting optimisation flags]
= [ ([0,1,2], Opt_DoLambdaEtaExpansion)
, ([0,1,2], Opt_DoEtaReduction) -- See Note [Eta-reduction in -O0]
- , ([0,1,2], Opt_LlvmTBAA)
, ([0,1,2], Opt_ProfManualCcs )
, ([2], Opt_DictsStrict)
diff --git a/configure.ac b/configure.ac
index c035fa70ef..16b657e9c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -550,7 +550,7 @@ AC_SUBST(InstallNameToolCmd)
# versions of LLVM simultaneously, but that stopped working around
# 3.5/3.6 release of LLVM.
LlvmMinVersion=10 # inclusive
-LlvmMaxVersion=15 # not inclusive
+LlvmMaxVersion=16 # not inclusive
AC_SUBST([LlvmMinVersion])
AC_SUBST([LlvmMaxVersion])
sUPPORTED_LLVM_VERSION_MIN=$(echo \($LlvmMinVersion\) | sed 's/\./,/')
diff --git a/llvm-passes b/llvm-passes
index 14eb62d87c..f72c67ae6c 100644
--- a/llvm-passes
+++ b/llvm-passes
@@ -1,5 +1,5 @@
[
-(0, "-mem2reg -globalopt -lower-expect"),
-(1, "-O1 -globalopt"),
-(2, "-O2")
+(0, "-passes=tbaa,mem2reg,globalopt,lower-expect"),
+(1, "-passes=tbaa,default1,-globalopt"),
+(2, "-passes=tbaa,default2")
]