[Git][ghc/ghc][wip/bump-llvm] llvmGen: Adapt to allow use of new pass manager.

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Wed Jan 31 21:07:03 UTC 2024



Ben Gamari pushed to branch wip/bump-llvm at Glasgow Haskell Compiler / GHC


Commits:
3e91911a by Ben Gamari at 2024-01-31T16:06:52-05:00
llvmGen: Adapt to allow use of new pass manager.

We now must use `-passes` in place of `-O<n>` due to #21936.

Closes #21936.

- - - - -


5 changed files:

- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- llvm-passes


Changes:

=====================================
compiler/GHC/Driver/DynFlags.hs
=====================================
@@ -1250,7 +1250,6 @@ optLevelFlags -- see Note [Documenting optimisation flags]
   = [ ([0,1,2], Opt_DoLambdaEtaExpansion)
     , ([1,2],   Opt_DoCleverArgEtaExpansion) -- See Note [Eta expansion of arguments in CorePrep]
     , ([0,1,2], Opt_DoEtaReduction)          -- See Note [Eta-reduction in -O0]
-    , ([0,1,2], Opt_LlvmTBAA)
     , ([0,1,2], Opt_ProfManualCcs )
     , ([2], Opt_DictsStrict)
 


=====================================
compiler/GHC/Driver/Flags.hs
=====================================
@@ -286,7 +286,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
@@ -529,7 +528,6 @@ optimisationFlags = EnumSet.fromList
    , Opt_EnableRewriteRules
    , Opt_RegsGraph
    , Opt_RegsIterative
-   , Opt_LlvmTBAA
    , Opt_IrrefutableTuples
    , Opt_CmmSink
    , Opt_CmmElimCommonBlocks


=====================================
compiler/GHC/Driver/Pipeline/Execute.hs
=====================================
@@ -930,8 +930,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)]
 
     -- Additional llc flags


=====================================
compiler/GHC/Driver/Session.hs
=====================================
@@ -2411,7 +2411,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,


=====================================
llvm-passes
=====================================
@@ -1,5 +1,5 @@
 [
-(0, "-enable-new-pm=0 -mem2reg -globalopt -lower-expect"),
-(1, "-enable-new-pm=0 -O1 -globalopt"),
-(2, "-enable-new-pm=0 -O2")
+(0, "-passes=function(require<tbaa>),function(mem2reg),globalopt,function(lower-expect)"),
+(1, "-passes=default<O1>"),
+(2, "-passes=default<O2>")
 ]



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3e91911aef8d00ace1ee607138f4c1a5e486287f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3e91911aef8d00ace1ee607138f4c1a5e486287f
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240131/b1528737/attachment-0001.html>


More information about the ghc-commits mailing list