diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2018-04-13 13:23:13 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-04-13 14:17:14 -0400 |
commit | 3c7f9e74ca858de17bc63b862c77cbb3f8b0ee51 (patch) | |
tree | af721ec9e3cca9630d331be2843606aa51963529 /docs/users_guide/using-optimisation.rst | |
parent | 00b8ecb78624511a045120673b01fafe5794ecdc (diff) | |
download | haskell-3c7f9e74ca858de17bc63b862c77cbb3f8b0ee51.tar.gz |
Make shortcutting at the asm stage toggleable and default for O2.
Shortcutting during the asm stage of codegen is often redundant as most
cases get caught during the Cmm passes. For example during compilation
of all of nofib only 508 jumps are eleminated.
For this reason I moved the pass from -O1 to -O2. I also made it
toggleable with -fasm-shortcutting.
Test Plan: ci
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D4555
Diffstat (limited to 'docs/users_guide/using-optimisation.rst')
-rw-r--r-- | docs/users_guide/using-optimisation.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/users_guide/using-optimisation.rst b/docs/users_guide/using-optimisation.rst index 84664062dc..59edcdc320 100644 --- a/docs/users_guide/using-optimisation.rst +++ b/docs/users_guide/using-optimisation.rst @@ -217,6 +217,23 @@ by saying ``-fno-wombat``. to their usage sites. It also inlines simple expressions like literals or registers. +.. ghc-flag:: -fasm-shortcutting + :shortdesc: Enable shortcutting on assembly. Implied by :ghc-flag:`-O2`. + :type: dynamic + :reverse: -fno-asm-shortcutting + :category: + + :default: off + + This enables shortcutting at the assembly stage of the code generator. + In simpler terms shortcutting means if a block of instructions A only consists + of a unconditionally jump, we replace all jumps to A by jumps to the successor + of A. + + This is mostly done during Cmm passes. However this can miss corner cases. So at -O2 + we run the pass again at the asm stage to catch these. + + .. ghc-flag:: -fcpr-anal :shortdesc: Turn on CPR analysis in the demand analyser. Implied by :ghc-flag:`-O`. :type: dynamic |