1. 22 Mar, 2022 1 commit
  2. 22 Dec, 2021 3 commits
    • Alan Zimmerman's avatar
      Fix panic trying to -ddump-parsed-ast for implicit fixity · 09b6cb45
      Alan Zimmerman authored and  Marge Bot's avatar Marge Bot committed
      A declaration such as
      
          infixr ++++
      
      is supplied with an implicit fixity of 9 in the parser, but uses
      an invalid SrcSpan to capture this. Use of this span triggers a panic.
      
      Fix the problem by not recording an exact print annotation for the
      non-existent fixity source.
      
      Closes #20846
      09b6cb45
    • Matthew Pickering's avatar
      ci: Fix master CI · d7cc8f19
      Matthew Pickering authored and  Marge Bot's avatar Marge Bot committed
      I made a mistake in the bash script so there were errors about
      "$CI_MERGE_REQUEST_DIFF_BASE_SHA" not existing.
      d7cc8f19
    • doyougnu's avatar
      Cmm: DynFlags to CmmConfig refactor · 1a596d06
      doyougnu authored and  Marge Bot's avatar Marge Bot committed
      add files GHC.Cmm.Config, GHC.Driver.Config.Cmm
      
      Cmm: DynFlag references --> CmmConfig
      
      Cmm.Pipeline: reorder imports, add handshake
      
      Cmm: DynFlag references --> CmmConfig
      
      Cmm.Pipeline: DynFlag references --> CmmConfig
      
      Cmm.LayoutStack: DynFlag references -> CmmConfig
      
      Cmm.Info.Build: DynFlag references -> CmmConfig
      
      Cmm.Config: use profile to retrieve platform
      
      Cmm.CLabel: unpack NCGConfig in labelDynamic
      
      Cmm.Config: reduce CmmConfig surface area
      
      Cmm.Config: add cmmDoCmmSwitchPlans field
      
      Cmm.Config: correct cmmDoCmmSwitchPlans flag
      
      The original implementation dispatches work in cmmImplementSwitchPlans
      in an `otherwise` branch, hence we must add a not to correctly dispatch
      
      Cmm.Config: add cmmSplitProcPoints simplify Config
      
      remove cmmBackend, and cmmPosInd
      
      Cmm.CmmToAsm: move ncgLabelDynamic to CmmToAsm
      
      Cmm.CLabel: remove cmmLabelDynamic function
      
      Cmm.Config: rename cmmOptDoLinting -> cmmDoLinting
      
      testsuite: update CountDepsAst CountDepsParser
      1a596d06
  3. 21 Dec, 2021 8 commits
  4. 18 Dec, 2021 12 commits
    • Matthew Pickering's avatar
      testsuite: Ensure that -dcore-lint is not set for compiler performance tests · 887d8b4c
      Matthew Pickering authored and  Marge Bot's avatar Marge Bot committed
      This place ensures that the default -dcore-lint option is disabled by
      default when collect_compiler_stats is used but you can still pass
      -dcore-lint as an additional option (see T1969 which tests core lint
      performance).
      
      Fixes #20830
      
      -------------------------
      Metric Decrease:
          PmSeriesS
          PmSeriesT
          PmSeriesV
          T10858
          T11195
          T11276
          T11374
          T11822
          T14052
          T14052Type
          T17096
          T17836
          T17836b
          T18478
          T18698a
          T18698b
      -------------------------
      887d8b4c
    • Sylvain Henry's avatar
      Perf: avoid using (replicateM . length) when possible · 9529d859
      Sylvain Henry authored and  Marge Bot's avatar Marge Bot committed
      Extracted from !6622
      9529d859
    • Sebastian Graf's avatar
      Demand: `Eq DmdType` modulo `defaultFvDmd` (#20827) · a3552934
      Sebastian Graf authored and  Marge Bot's avatar Marge Bot committed
      Fixes #20827 by filtering out any default free variable demands (as per
      `defaultFvDmd`) prior to comparing the assocs of the `DmdEnv`.
      The details are in `Note [Demand type Equality]`.
      a3552934
    • Cheng Shao's avatar
      Binary: make withBinBuffer safe · 94c3ff66
      Cheng Shao authored and  Marge Bot's avatar Marge Bot committed
      With this patch, withBinBuffer will construct a ByteString that
      properly captures the reference to the BinHandle internal
      MutableByteArray#, making it safe to convert a BinHandle to ByteString
      and use that ByteString outside the continuation.
      94c3ff66
    • Matthew Pickering's avatar
      Expand documentation for MulArrowT constructor · abef93f3
      Matthew Pickering authored and  Marge Bot's avatar Marge Bot committed
      Fixes #20812
      abef93f3
    • Matthew Pickering's avatar
      Fix documentation formatting in Language.Haskell.TH.CodeDo · fc9b1755
      Matthew Pickering authored and  Marge Bot's avatar Marge Bot committed
      Fixes #20543
      fc9b1755
    • Matthew Pickering's avatar
      Add regression test for T20189 · 1327c176
      Matthew Pickering authored and  Marge Bot's avatar Marge Bot committed
      Closes #20189
      1327c176
    • Matthew Pickering's avatar
      ci: Use correct metrics baseline · e04878b0
      Matthew Pickering authored and  Marge Bot's avatar Marge Bot committed
      It turns out there was already a function in the CI script to correctly
      set the baseline for performance tests but it was just never called. I
      now call it during the initialisation to set the correct baseline.
      
      I also made the make testsuite driver take into account the
      PERF_BASELINE_COMMIT environment variable
      
      Fixes #20811
      e04878b0
    • Sylvain Henry's avatar
      Perf: inline exprIsCheapX · 3f31bfe8
      Sylvain Henry authored and  Marge Bot's avatar Marge Bot committed
      Allow specialization for the ok_app predicate.
      
      Perf improvements:
      
                                                     Baseline
                                 Test    Metric         value     New value Change
      -----------------------------------------------------------------------------
             ManyAlternatives(normal) ghc/alloc   747317244.0   746444024.0  -0.1%
             ManyConstructors(normal) ghc/alloc  4005046448.0  4001548792.0  -0.1%
            MultiLayerModules(normal) ghc/alloc  3063361000.0  3063178472.0  -0.0%
      MultiLayerModulesRecomp(normal) ghc/alloc   894208428.0   894252496.0  +0.0%
                    PmSeriesG(normal) ghc/alloc    48021692.0    47901592.0  -0.3%
                    PmSeriesS(normal) ghc/alloc    61322504.0    61149008.0  -0.3%
                    PmSeriesT(normal) ghc/alloc    90879364.0    90609048.0  -0.3%
                    PmSeriesV(normal) ghc/alloc    60155376.0    59983632.0  -0.3%
                       T10421(normal) ghc/alloc   112820720.0   112517208.0  -0.3%
                      T10421a(normal) ghc/alloc    78783696.0    78557896.0  -0.3%
                       T10547(normal) ghc/alloc    28331984.0    28354160.0  +0.1%
                       T10858(normal) ghc/alloc   180715296.0   180226720.0  -0.3%
                       T11195(normal) ghc/alloc   284139184.0   283981048.0  -0.1%
                       T11276(normal) ghc/alloc   137830804.0   137688912.0  -0.1%
                      T11303b(normal) ghc/alloc    44080856.0    43956152.0  -0.3%
                       T11374(normal) ghc/alloc   249319644.0   249059288.0  -0.1%
                       T11545(normal) ghc/alloc   971507488.0   971146136.0  -0.0%
                       T11822(normal) ghc/alloc   131410208.0   131269664.0  -0.1%
                       T12150(optasm) ghc/alloc    78866860.0    78762296.0  -0.1%
                       T12227(normal) ghc/alloc   494467900.0   494138112.0  -0.1%
                       T12234(optasm) ghc/alloc    56781044.0    56588256.0  -0.3%
                       T12425(optasm) ghc/alloc    90462264.0    90240272.0  -0.2%
                       T12545(normal) ghc/alloc  1694316588.0  1694128448.0  -0.0%
                       T12707(normal) ghc/alloc   955665168.0   955005336.0  -0.1%
                       T13035(normal) ghc/alloc   101875160.0   101713312.0  -0.2%
                       T13056(optasm) ghc/alloc   366370168.0   365347632.0  -0.3%
                       T13253(normal) ghc/alloc   333741472.0   332612920.0  -0.3%
                   T13253-spj(normal) ghc/alloc   124947560.0   124427552.0  -0.4%
                       T13379(normal) ghc/alloc   358997996.0   358879840.0  -0.0%
                       T13701(normal) ghc/alloc  2400391456.0  2399956840.0  -0.0%
                       T13719(normal) ghc/alloc  4193179228.0  4192476392.0  -0.0%
                         T14052(ghci) ghc/alloc  2734741552.0  2735731808.0  +0.0%
                     T14052Type(ghci) ghc/alloc  7323235724.0  7323042264.0  -0.0%
                       T14683(normal) ghc/alloc  2990457260.0  2988899144.0  -0.1%
                       T14697(normal) ghc/alloc   363606476.0   363452952.0  -0.0%
                       T15164(normal) ghc/alloc  1291321780.0  1289491968.0  -0.1%
                       T15304(normal) ghc/alloc  1277838020.0  1276208304.0  -0.1%
                       T15630(normal) ghc/alloc   161074632.0   160388136.0  -0.4%
                       T16190(normal) ghc/alloc   276567192.0   276235216.0  -0.1%
                       T16577(normal) ghc/alloc  7564318656.0  7535598656.0  -0.4%
                       T16875(normal) ghc/alloc    34867720.0    34752440.0  -0.3%
                       T17096(normal) ghc/alloc   288477360.0   288156960.0  -0.1%
                       T17516(normal) ghc/alloc  1712777224.0  1704655496.0  -0.5%
                       T17836(normal) ghc/alloc  1092127336.0  1091709880.0  -0.0%
                      T17836b(normal) ghc/alloc    52083516.0    51954056.0  -0.2%
                       T17977(normal) ghc/alloc    44552228.0    44425448.0  -0.3%
                      T17977b(normal) ghc/alloc    40540252.0    40416856.0  -0.3%
                       T18140(normal) ghc/alloc    81908200.0    81678928.0  -0.3%
                       T18223(normal) ghc/alloc  1166459176.0  1164418104.0  -0.2%
                       T18282(normal) ghc/alloc   131123648.0   130740432.0  -0.3%
                       T18304(normal) ghc/alloc    86486796.0    86223088.0  -0.3%
                       T18478(normal) ghc/alloc   746029440.0   745619968.0  -0.1%
                      T18698a(normal) ghc/alloc   337037580.0   336533824.0  -0.1%
                      T18698b(normal) ghc/alloc   398324600.0   397696400.0  -0.2%
                       T18923(normal) ghc/alloc    68496432.0    68286264.0  -0.3%
                        T1969(normal) ghc/alloc   760424696.0   759641664.0  -0.1%
                       T19695(normal) ghc/alloc  1421672472.0  1413682104.0  -0.6%
                       T20049(normal) ghc/alloc    88601524.0    88336560.0  -0.3%
                        T3064(normal) ghc/alloc   190808832.0   190659328.0  -0.1%
                        T3294(normal) ghc/alloc  1604483120.0  1604339080.0  -0.0%
                        T4801(normal) ghc/alloc   296501624.0   296388448.0  -0.0%
                        T5030(normal) ghc/alloc   364336308.0   364206240.0  -0.0%
                      T5321FD(normal) ghc/alloc   270688492.0   270386832.0  -0.1%
                     T5321Fun(normal) ghc/alloc   300860396.0   300559200.0  -0.1%
                        T5631(normal) ghc/alloc   575822760.0   575579160.0  -0.0%
                        T5642(normal) ghc/alloc   470243356.0   468988784.0  -0.3%
                        T5837(normal) ghc/alloc    35936468.0    35821360.0  -0.3%
                        T6048(optasm) ghc/alloc   102587024.0   102222000.0  -0.4%
                         T783(normal) ghc/alloc   386539204.0   386003344.0  -0.1%
                        T9020(optasm) ghc/alloc   247435312.0   247324184.0  -0.0%
                        T9198(normal) ghc/alloc    47170036.0    47054840.0  -0.2%
                        T9233(normal) ghc/alloc   677186820.0   676550032.0  -0.1%
                        T9630(normal) ghc/alloc  1456411516.0  1451045736.0  -0.4%
                        T9675(optasm) ghc/alloc   427190224.0   426812568.0  -0.1%
                       T9872a(normal) ghc/alloc  1704660040.0  1704681856.0  +0.0%
                       T9872b(normal) ghc/alloc  2180109488.0  2180130856.0  +0.0%
                       T9872c(normal) ghc/alloc  1760209640.0  1760231456.0  +0.0%
                       T9872d(normal) ghc/alloc   501126052.0   500973488.0  -0.0%
                        T9961(normal) ghc/alloc   353244688.0   353063104.0  -0.1%
         TcPlugin_RewritePerf(normal) ghc/alloc  2387276808.0  2387254168.0  -0.0%
                        WWRec(normal) ghc/alloc   588651140.0   587684704.0  -0.2%
               hard_hole_fits(normal) ghc/alloc   492063812.0   491798360.0  -0.1%
                       hie002(normal) ghc/alloc  9334355960.0  9334396872.0  +0.0%
                   parsing001(normal) ghc/alloc   537410584.0   537421736.0  +0.0%
      
                            geo. mean                                        -0.2%
      3f31bfe8
    • Matthew Pickering's avatar
      testsuite: Format metric results with comma separator · 9d77976d
      Matthew Pickering authored and  Marge Bot's avatar Marge Bot committed
      As noted in #20763 the way the stats were printed was quite hard for a
      human to compare. Therefore we now insert the comma separator so that
      they are easier to compare at a glance.
      
      Before:
      
      ```
                                                    Baseline
                               Test    Metric          value      New value Change
      -----------------------------------------------------------------------------
                Conversions(normal) run/alloc       107088.0       107088.0  +0.0%
                 DeriveNull(normal) run/alloc    112050656.0    112050656.0  +0.0%
           InlineArrayAlloc(normal) run/alloc   1600040712.0   1600040712.0  +0.0%
       InlineByteArrayAlloc(normal) run/alloc   1440040712.0   1440040712.0  +0.0%
      InlineCloneArrayAlloc(normal) run/alloc   1600040872.0   1600040872.0  +0.0%
                MethSharing(normal) run/alloc    480097864.0    480097864.0  +0.0%
                     T10359(normal) run/alloc       354344.0       354344.0  +0.0%
      ```
      
      After
      
      ```
                                                       Baseline
                               Test    Metric             value         New value Change
      ----------------------------------------------------------------------------------
                Conversions(normal) run/alloc         107,088         107,088     +0.0%
                 DeriveNull(normal) run/alloc     112,050,656     112,050,656     +0.0%
           InlineArrayAlloc(normal) run/alloc   1,600,040,712   1,600,040,712     +0.0%
       InlineByteArrayAlloc(normal) run/alloc   1,440,040,712   1,440,040,712     +0.0%
      InlineCloneArrayAlloc(normal) run/alloc   1,600,040,872   1,600,040,872     +0.0%
                MethSharing(normal) run/alloc     480,097,864     480,097,864     +0.0%
                     T10359(normal) run/alloc         354,344         354,344     +0.0%
      ```
      
      Closes #20763
      9d77976d
    • Krzysztof Gogolewski's avatar
      Change isUnliftedTyCon to marshalablePrimTyCon (#20401) · 5d5620bc
      Krzysztof Gogolewski authored and  Marge Bot's avatar Marge Bot committed
      isUnliftedTyCon was used in three places: Ticky, Template Haskell
      and FFI checks.
      
      It was straightforward to remove it from Ticky and Template Haskell.
      
      It is now used in FFI only and renamed to marshalablePrimTyCon.
      
      Previously, it was fetching information from a field
      in PrimTyCon called is_unlifted. Instead, I've changed the code
      to compute liftedness based on the kind.
      
      isFFITy and legalFFITyCon are removed. They were only referred from
      an old comment that I removed.
      
      There were three functions to define a PrimTyCon, but the only difference
      was that they were setting is_unlifted to True or False.
      Everything is now done in mkPrimTyCon.
      
      I also added missing integer types in Ticky.hs, I think it was an oversight.
      
      Fixes #20401
      5d5620bc
    • Ben Gamari's avatar
      Regression test for renamer/typechecker performance (#20261) · 3c3e5c03
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      We use the parser generated by stack to ensure reproducibility
      3c3e5c03
  5. 15 Dec, 2021 16 commits
    • Cheng Shao's avatar
      Add a note to base changelog · 6cea7311
      Cheng Shao authored and  Marge Bot's avatar Marge Bot committed
      6cea7311
    • Cheng Shao's avatar
      base: fix autoconf detection of C pointer types · 89c1ffd6
      Cheng Shao authored and  Marge Bot's avatar Marge Bot committed
      We used to attempt compiling `foo_t val; *val;` to determine if `foo_t`
      is a pointer type in C. This doesn't work if `foo_t` points to an
      incomplete type, and autoconf will detect `foo_t` as a floating point
      type in that case. Now we use `memset(val, 0, 0)` instead, and it works
      for incomplete types as well.
      89c1ffd6
    • Cheng Shao's avatar
      base: use `CUIntPtr` instead of `Ptr ()` as the autoconf detected Haskell type for C pointers · d13b9f20
      Cheng Shao authored and  Marge Bot's avatar Marge Bot committed
      When autoconf detects a C pointer type, we used to specify `Ptr ()` as
      the Haskell type. This doesn't work in some cases, e.g. in `wasi-libc`,
      `clockid_t` is a pointer type, but we expected `CClockId` to be an
      integral type, and `Ptr ()` lacks various integral type instances.
      d13b9f20
    • abarbu's avatar
      Plugin load order should follow the commandline order (fixes #17884) · f5a0b408
      abarbu authored and  Marge Bot's avatar Marge Bot committed
      In the past the order was reversed because flags are consed onto a list.
      No particular behavior was documented.
      
      We now reverse the flags and document the behavior.
      f5a0b408
    • Joachim Breitner's avatar
      Test case from #19313 · 45bd6308
      Joachim Breitner authored and  Marge Bot's avatar Marge Bot committed
      45bd6308
    • Greg Steuck's avatar
      Add OpenBSD to llvm-targets · 34abbd81
      Greg Steuck authored and  Marge Bot's avatar Marge Bot committed
      This improves some tests that previously failed with:
      
      ghc: panic! (the 'impossible' happened)
        GHC version 9.3.20211211:
              Failed to lookup LLVM data layout
        Target: x86_64-unknown-openbsd
      
      Added the new generated lines to `llvm-targets` on an openbsd
      7.0-current with clang 11.1.0.
      34abbd81
    • doyougnu's avatar
      CmmToLlvm: rename LCGConfig -> LlvmCgConfig · 70f0aafe
      doyougnu authored and  Marge Bot's avatar Marge Bot committed
      CmmToLlvm: renamce lcgPlatform -> llvmCgPlatform
      
      CmmToLlvm: rename lcgContext -> llvmCgContext
      
      CmmToLlvm: rename lcgFillUndefWithGarbage
      
      CmmToLlvm: rename lcgSplitSections
      
      CmmToLlvm: lcgBmiVersion -> llvmCgBmiVersion
      
      CmmToLlvm: lcgLlvmVersion -> llvmCgLlvmVersion
      
      CmmToLlvm: lcgDoWarn -> llvmCgDoWarn
      
      CmmToLlvm: lcgLlvmConfig -> llvmCgLlvmConfig
      
      CmmToLlvm: llvmCgPlatformMisc --> llvmCgLlvmTarget
      70f0aafe
    • doyougnu's avatar
      CmmToLlvm.Config: strictify LlvmConfig field · bc663f87
      doyougnu authored and  Marge Bot's avatar Marge Bot committed
      bc663f87
    • doyougnu's avatar
      LLVM.CodeGen: use fast-string literals · 80016022
      doyougnu authored and  Marge Bot's avatar Marge Bot committed
      That is remove factorization of common strings and string building
      code for the LLVM code gen ops. Replace these with string literals
      to obey the FastString rewrite rule in GHC.Data.FastString and compute
      the string length at compile time
      80016022
    • doyougnu's avatar
      SysTools.Tasks Llvm.Types: remove redundant import · 6b0fb9a0
      doyougnu authored and  Marge Bot's avatar Marge Bot committed
      Llvm.Types: remove redundant import
      
      SysTools.Tasks: remove redundant import
      
      - namely CmmToLlvm.Base
      6b0fb9a0
    • doyougnu's avatar
      CmmToLlvm: Remove DynFlags, add LlvmCgConfig · ecaec722
      doyougnu authored and  Marge Bot's avatar Marge Bot committed
      CodeOutput: LCGConfig, add handshake initLCGConfig
      
      Add two modules:
      GHC.CmmToLlvm.Config                -- to hold the Llvm code gen config
      GHC.Driver.Config.CmmToLlvm         -- for initialization, other utils
      
      CmmToLlvm: remove HasDynFlags, add LlvmConfig
      
      CmmToLlvm: add lcgContext to LCGConfig
      
      CmmToLlvm.Base: DynFlags --> LCGConfig
      
      Llvm: absorb LlvmOpts into LCGConfig
      
      CmmToLlvm.Ppr: swap DynFlags --> LCGConfig
      
      CmmToLlvm.CodeGen: swap DynFlags --> LCGConfig
      
      CmmToLlvm.CodeGen: swap DynFlags --> LCGConfig
      
      CmmToLlvm.Data: swap LlvmOpts --> LCGConfig
      
      CmmToLlvm: swap DynFlags --> LCGConfig
      
      CmmToLlvm: move LlvmVersion to CmmToLlvm.Config
      
      Additionally:
      - refactor Config and initConfig to hold LlvmVersion
      - push IO needed to get LlvmVersion to boundary between Cmm and LLvm
      code generation
      - remove redundant imports, this is much cleaner!
      
      CmmToLlvm.Config: store platformMisc_llvmTarget
      
      instead of all of platformMisc
      ecaec722
    • Ben Gamari's avatar
      libiserv: Rename Lib module to IServ · 0198bb11
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      As proposed in #20546.
      0198bb11
    • Ben Gamari's avatar
      ghc-bin: Add --merge-objs mode · 5686f47b
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      This adds a new mode, `--merge-objs`, which can be used to produce
      merged GHCi library objects.
      
      As future work we will rip out the object-merging logic in Hadrian and
      Cabal and instead use this mode.
      
      Closes #20712.
      5686f47b
    • Ben Gamari's avatar
      compiler: Use withFile instead of bracket · 71ecb55b
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      A minor refactoring noticed by hlint.
      71ecb55b
    • Ben Gamari's avatar
      compiler: Drop `Maybe ModLocation` from T_MergeForeign · 4f654071
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      This field was entirely unused.
      4f654071
    • Ben Gamari's avatar
      users-guide: Fix documentation for -shared flag · 82c39f4d
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      This flag was previously called `--mk-dll`. It was renamed to `-shared`
      in b562cbe3 but the documentation wasn't
      updated to match.
      82c39f4d