1. 19 Aug, 2020 3 commits
    • Alex D's avatar
      Implement -Wredundant-bang-patterns (#17340) · 731c8d3b
      Alex D authored
      Add new flag '-Wredundant-bang-patterns' that enables checks for "dead" bangs.
      Dead bangs are the ones that under no circumstances can force a thunk that
      wasn't already forced. Dead bangs are a form of redundant bangs. The new check
      is performed in Pattern-Match Coverage Checker along with other checks (namely,
      redundant and inaccessible RHSs). Given
          f :: Bool -> Int
          f True = 1
          f !x   = 2
      we can detect dead bang patterns by checking whether @x ~ ⊥@ is satisfiable
      where the PmBang appears in 'checkGrdTree'. If not, then clearly the bang is
      dead. Such a dead bang is then indicated in the annotated pattern-match tree by
      a 'RedundantSrcBang' wrapping. In 'redundantAndInaccessibles', we collect
      all dead bangs to warn about.
      Note that we don't want to warn for a dead bang that appears on a redundant
      clause. That is because in that case, we recommend to delete the clause wholly,
      including its leading pattern match.
      Dead bang patterns are redundant. B...
    • Sylvain Henry's avatar
      DynFlags: refactor GHC.CmmToAsm (#17957, #10143) · 0c5ed5c7
      Sylvain Henry authored
      This patch removes the use of `sdocWithDynFlags` from GHC.CmmToAsm.*.Ppr
      To do that I've had to make some refactoring:
      * X86' and PPC's `Instr` are no longer `Outputable` as they require a
        `Platform` argument
      * `Instruction` class now exposes `pprInstr :: Platform -> instr -> SDoc`
      * as a consequence, I've refactored some modules to avoid .hs-boot files
      * added (derived) functor instances for some datatypes parametric in the
        instruction type. It's useful for pretty-printing as we just have to
        map `pprInstr` before pretty-printing the container datatype.
    • Ben Gamari's avatar
      testsuite: Only run llvm ways if llc is available · aa4b744d
      Ben Gamari authored
      As noted in #18560, we previously would always run the LLVM ways since
      `configure` would set `SettingsLlcCommand` to something non-null when
      it otherwise couldn't find the `llc` executable. Now we rather probe for
      the existence of the `llc` executable in the testsuite driver.
      Fixes #18560.
  2. 18 Aug, 2020 6 commits
  3. 14 Aug, 2020 3 commits
    • Ben Gamari's avatar
      llvm-targets: Add i686 targets · 55fd1dc5
      Ben Gamari authored
      Addresses #18422.
    • Ben Gamari's avatar
      testsuite: Drop --io-manager flag from testsuite configuration · 9f66fdf6
      Ben Gamari authored
      This is no longer necessary as there are now dedicated testsuite ways
      which run tests with WinIO.
    • Sylvain Henry's avatar
      Make IOEnv monad one-shot (#18202) · 8a51b2ab
      Sylvain Henry authored
      On CI (x86_64-linux-deb9-hadrian, compile_time/bytes_allocated):
          T10421     -1.8%    (threshold: +/- 1%)
          T10421a    -1.7%    (threshold: +/- 1%)
          T12150     -4.9%    (threshold: +/- 2%)
          T12227     -1.6     (threshold: +/- 1%)
          T12425     -1.5%    (threshold: +/- 1%)
          T12545     -3.8%    (threshold: +/- 1%)
          T12707     -3.0%    (threshold: +/- 1%)
          T13035     -3.0%    (threshold: +/- 1%)
          T14683     -10.3%   (threshold: +/- 2%)
          T3064      -6.9%    (threshold: +/- 2%)
          T4801      -4.3%    (threshold: +/- 2%)
          T5030      -2.6%    (threshold: +/- 2%)
          T5321FD    -3.6%    (threshold: +/- 2%)
          T5321Fun   -4.6%    (threshold: +/- 2%)
          T5631      -19.7%   (threshold: +/- 2%)
          T5642      -13.0%   (threshold: +/- 2%)
          T783       -2.7     (threshold: +/- 2%)
          T9020      -11.1    (threshold: +/- 2%)
          T9961      -3.4%    (threshold: +/- 2%)
          T1969 (compile_time/bytes_allocated)  -2.2%  (threshold: +/-1%)
          T1969 (compile_time/max_bytes_used)   +24.4% (threshold: +/-20%)
      Additionally on other CIs:
          haddock.Cabal                  -10.0%   (threshold: +/- 5%)
          haddock.compiler               -9.5%    (threshold: +/- 5%)
          haddock.base (max bytes used)  +24.6%   (threshold: +/- 15%)
          T10370 (max bytes used, i386)  +18.4%   (threshold: +/- 15%)
      Metric Decrease:
      Metric Decrease 'compile_time/bytes allocated':
      Metric Increase 'compile_time/max_bytes_used':
  4. 13 Aug, 2020 6 commits
    • Sylvain Henry's avatar
      Add HomeUnit type · ffc0d578
      Sylvain Henry authored
      Since Backpack the "home unit" is much more involved than what it was
      before (just an identifier obtained with `-this-unit-id`). Now it is
      used in conjunction with `-component-id` and `-instantiated-with` to
      configure module instantiations and to detect if we are type-checking an
      indefinite unit or compiling a definite one.
      This patch introduces a new HomeUnit datatype which is much easier to
      understand. Moreover to make GHC support several packages in the same
      instances, we will need to handle several HomeUnits so having a
      dedicated (documented) type is helpful.
      Finally in #14335 we will also need to handle the case where we have no
      HomeUnit at all because we are only loading existing interfaces for
      plugins which live in a different space compared to units used to
      produce target code. Several functions will have to be refactored to
      accept "Maybe HomeUnit" parameters instead of implicitly querying the
      HomeUnit fields in DynFlags. Having a dedicated type will make this
      Bump had...
    • Hécate Moonlight's avatar
      Re-add BangPatterns to CodePage.hs · cf97889a
      Hécate Moonlight authored
    • Sebastian Graf's avatar
      PmCheck: Better long-distance info for where bindings (#18533) · 55dec4dc
      Sebastian Graf authored
      Where bindings can see evidence from the pattern match of the `GRHSs`
      they belong to, but not from anything in any of the guards (which belong
      to one of possibly many RHSs).
      Before this patch, we did *not* consider said evidence, causing #18533,
      where the lack of considering type information from a case pattern match
      leads to failure to resolve the vanilla COMPLETE set of a data type.
      Making available that information required a medium amount of
      refactoring so that `checkMatches` can return a
      `[(Deltas, NonEmpty Deltas)]`; one `(Deltas, NonEmpty Deltas)` for each
      `GRHSs` of the match group. The first component of the pair is the
      covered set of the pattern, the second component is one covered set per
      Fixes #18533.
      Regression test case: T18533
    • Ben Gamari's avatar
      parser: Suggest ImportQualifiedPost in prepositive import warning · 7831fe05
      Ben Gamari authored
      As suggested in #18545.
    • Alan Zimmerman's avatar
    • Sylvain Henry's avatar
      Rewrite and move the monad-state hack note · bee43aca
      Sylvain Henry authored
      The note has been rewritten by @simonpj in !3851
      [skip ci]
  5. 12 Aug, 2020 6 commits
  6. 11 Aug, 2020 3 commits
  7. 10 Aug, 2020 2 commits
  8. 09 Aug, 2020 1 commit
  9. 08 Aug, 2020 2 commits
  10. 07 Aug, 2020 7 commits
  11. 06 Aug, 2020 1 commit