[Git][ghc/ghc][wip/perf-ci] 7 commits: Introduce OutputableP

Ben Gamari gitlab at gitlab.haskell.org
Fri Sep 18 17:04:37 UTC 2020



Ben Gamari pushed to branch wip/perf-ci at Glasgow Haskell Compiler / GHC


Commits:
ca48076a by Sylvain Henry at 2020-09-17T20:04:08-04:00
Introduce OutputableP

Some types need a Platform value to be pretty-printed: CLabel, Cmm
types, instructions, etc.

Before this patch they had an Outputable instance and the Platform value
was obtained via sdocWithDynFlags. It meant that the *renderer* of the
SDoc was responsible of passing the appropriate Platform value (e.g. via
the DynFlags given to showSDoc).  It put the burden of passing the
Platform value on the renderer while the generator of the SDoc knows the
Platform it is generating the SDoc for and there is no point passing a
different Platform at rendering time.

With this patch, we introduce a new OutputableP class:

   class OutputableP a where
      pdoc :: Platform -> a -> SDoc

With this class we still have some polymorphism as we have with `ppr`
(i.e. we can use `pdoc` on a variety of types instead of having a
dedicated `pprXXX` function for each XXX type).

One step closer removing `sdocWithDynFlags` (#10143) and supporting
several platforms (#14335).

- - - - -
e45c8544 by Sylvain Henry at 2020-09-17T20:04:08-04:00
Generalize OutputableP

Add a type parameter for the environment required by OutputableP. It
avoids tying Platform with OutputableP.

- - - - -
37aa224a by Sylvain Henry at 2020-09-17T20:04:08-04:00
Add note about OutputableP

- - - - -
7f2785f2 by Sylvain Henry at 2020-09-17T20:04:08-04:00
Remove pprPrec from Outputable (unused)

- - - - -
b689f3db by Sylvain Henry at 2020-09-17T20:04:46-04:00
Bignum: add clamping naturalToWord (fix #18697)

- - - - -
32d87ee3 by Ben Gamari at 2020-09-18T13:04:32-04:00
ci.sh: Factor out common utilities

- - - - -
c20aac79 by Ben Gamari at 2020-09-18T13:04:32-04:00
ci: Add ad-hoc performance testing rule

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- + .gitlab/common.sh
- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/Cmm/DebugBlock.hs
- compiler/GHC/Cmm/Info/Build.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Lint.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/Pipeline.hs
- compiler/GHC/Cmm/Ppr.hs
- compiler/GHC/Cmm/Ppr/Decl.hs
- compiler/GHC/Cmm/Ppr/Expr.hs
- compiler/GHC/Cmm/ProcPoint.hs
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/CFG.hs
- compiler/GHC/CmmToAsm/Dwarf.hs
- compiler/GHC/CmmToAsm/Dwarf/Types.hs
- compiler/GHC/CmmToAsm/PPC/Ppr.hs
- compiler/GHC/CmmToAsm/Ppr.hs
- compiler/GHC/CmmToAsm/Reg/Graph.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs
- compiler/GHC/CmmToAsm/Reg/Liveness.hs
- compiler/GHC/CmmToAsm/SPARC.hs
- compiler/GHC/CmmToAsm/SPARC/CodeGen.hs
- compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs
- compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen64.hs
- compiler/GHC/CmmToAsm/SPARC/CodeGen/Sanity.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8ff42bbe2136b12e6d4f5b347e65affd51aaf021...c20aac7991774dc71cc43e151187e6f7c85d9d08

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8ff42bbe2136b12e6d4f5b347e65affd51aaf021...c20aac7991774dc71cc43e151187e6f7c85d9d08
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/20200918/a5c2769d/attachment.html>


More information about the ghc-commits mailing list