[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: testsuite: Only run llvm ways if llc is available
Marge Bot
gitlab at gitlab.haskell.org
Wed Aug 19 16:47:39 UTC 2020
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
aa4b744d by Ben Gamari at 2020-08-18T22:11:36-04:00
testsuite: Only run llvm ways if llc is available
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.
- - - - -
0c5ed5c7 by Sylvain Henry at 2020-08-18T22:12:13-04:00
DynFlags: refactor GHC.CmmToAsm (#17957, #10143)
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.
- - - - -
97337774 by nineonine at 2020-08-19T12:47:30-04:00
Implement -Wredundant-bang-patterns (#17340)
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. But there are bang patterns which are
redundant that aren't dead, for example
f !() = 0
the bang still forces the match variable, before we attempt to match on (). But
it is redundant with the forcing done by the () match. We currently don't
detect redundant bangs that aren't dead.
- - - - -
74e57004 by Simon Peyton Jones at 2020-08-19T12:47:32-04:00
Add right-to-left rule for pattern bindings
Fix #18323 by adding a few lines of code to handle non-recursive
pattern bindings. see GHC.Tc.Gen.Bind
Note [Special case for non-recursive pattern bindings]
Alas, this confused the pattern-match overlap checker; see #18323.
Note that this patch only affects pattern bindings like that
for (x,y) in this program
combine :: (forall a . [a] -> a) -> [forall a. a -> a]
-> ((forall a . [a] -> a), [forall a. a -> a])
breaks = let (x,y) = combine head ids
in x y True
We need ImpredicativeTypes for those [forall a. a->a] types to be
valid. And with ImpredicativeTypes the old, unprincipled "allow
unification variables to unify with a polytype" story actually
works quite well. So this test compiles fine (if delicatedly) with
old GHCs; but not with QuickLook unless we add this patch
- - - - -
30 changed files:
- compiler/GHC/Cmm.hs
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/BlockLayout.hs
- compiler/GHC/CmmToAsm/Instr.hs
- compiler/GHC/CmmToAsm/Monad.hs
- compiler/GHC/CmmToAsm/PIC.hs
- + compiler/GHC/CmmToAsm/PPC.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/Instr.hs
- compiler/GHC/CmmToAsm/PPC/Ppr.hs
- compiler/GHC/CmmToAsm/Reg/Graph.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs
- compiler/GHC/CmmToAsm/Reg/Linear/Stats.hs
- compiler/GHC/CmmToAsm/Reg/Liveness.hs
- + compiler/GHC/CmmToAsm/SPARC.hs
- compiler/GHC/CmmToAsm/SPARC/CodeGen.hs
- compiler/GHC/CmmToAsm/SPARC/CodeGen/Expand.hs
- compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen64.hs
- compiler/GHC/CmmToAsm/SPARC/CodeGen/Sanity.hs
- compiler/GHC/CmmToAsm/SPARC/Instr.hs
- compiler/GHC/CmmToAsm/SPARC/Ppr.hs
- + compiler/GHC/CmmToAsm/Types.hs
- + compiler/GHC/CmmToAsm/Utils.hs
- + compiler/GHC/CmmToAsm/X86.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/583ec18d44e75b47376e1cab5585e5dbc055b16c...74e57004c54728ad9e9f1e6af8ebb92365e8ed95
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/583ec18d44e75b47376e1cab5585e5dbc055b16c...74e57004c54728ad9e9f1e6af8ebb92365e8ed95
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/20200819/aad78ed8/attachment-0001.html>
More information about the ghc-commits
mailing list