ErrUtils: Add timings to compiler phases
authorBen Gamari <bgamari.foss@gmail.com>
Wed, 23 Mar 2016 15:11:45 +0000 (16:11 +0100)
committerBen Gamari <ben@smart-cactus.org>
Thu, 24 Mar 2016 09:53:27 +0000 (10:53 +0100)
commit8048d51be0676627b417c128af0b0c352b75c537
tree0d4ae8449cf93b94078587e6793e13dcd4a5ac76
parentda3b29bd1768d717753b7d1642e0e4e97750ae7b
ErrUtils: Add timings to compiler phases

This adds timings and allocation figures to the compiler's output when
run with `-v2` in an effort to ease performance analysis.

Todo:
  * Documentation
  * Where else should we add these?
  * Perhaps we should remove some of the now-arguably-redundant
    `showPass` occurrences where they are
  * Must we force more?
  * Perhaps we should place this behind a `-ftimings` instead of `-v2`

Test Plan: `ghc -v2 Test.hs`, look at the output

Reviewers: hvr, goldfire, simonmar, austin

Reviewed By: simonmar

Subscribers: angerman, michalt, niteria, ezyang, thomie

Differential Revision: https://phabricator.haskell.org/D1959
17 files changed:
compiler/cmm/CmmParse.y
compiler/coreSyn/CoreLint.hs
compiler/coreSyn/CorePrep.hs
compiler/deSugar/Desugar.hs
compiler/ghci/ByteCodeGen.hs
compiler/llvmGen/LlvmCodeGen.hs
compiler/llvmGen/LlvmMangler.hs
compiler/main/CodeOutput.hs
compiler/main/ErrUtils.hs
compiler/main/GhcMake.hs
compiler/main/HscMain.hs
compiler/main/TidyPgm.hs
compiler/simplCore/SimplCore.hs
compiler/typecheck/TcRnDriver.hs
compiler/utils/Outputable.hs
docs/users_guide/debugging.rst
docs/users_guide/using.rst