[commit: ghc] ghc-8.0: nativeGen: Allow -fregs-graph to be used (3ae474d)
git at git.haskell.org
git at git.haskell.org
Fri Jul 8 14:12:59 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.0
Link : http://ghc.haskell.org/trac/ghc/changeset/3ae474d18251d4e9184bf5d6cbce6ac86fdd46c1/ghc
>---------------------------------------------------------------
commit 3ae474d18251d4e9184bf5d6cbce6ac86fdd46c1
Author: Ben Gamari <bgamari.foss at gmail.com>
Date: Mon Jun 20 09:24:41 2016 +0200
nativeGen: Allow -fregs-graph to be used
Previously the flag was silently ignored due the #7679 and #8657. This,
however, seems unnecessarily brutal and makes experimentation unduly
difficult for users.
Test Plan: Validate
Reviewers: austin, simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2335
GHC Trac Issues: #7679, #8657
(cherry picked from commit 6a5d13c4ade5bbb84873970065a1acd1546f6c31)
>---------------------------------------------------------------
3ae474d18251d4e9184bf5d6cbce6ac86fdd46c1
compiler/nativeGen/AsmCodeGen.hs | 6 ++----
docs/users_guide/using-optimisation.rst | 28 +++++++++++++++++-----------
2 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/compiler/nativeGen/AsmCodeGen.hs b/compiler/nativeGen/AsmCodeGen.hs
index 2285d94..9e90c43 100644
--- a/compiler/nativeGen/AsmCodeGen.hs
+++ b/compiler/nativeGen/AsmCodeGen.hs
@@ -538,10 +538,8 @@ cmmNativeGen dflags this_mod modLoc ncgImpl us fileIds dbgMap cmm count
-- allocate registers
(alloced, usAlloc, ppr_raStatsColor, ppr_raStatsLinear) <-
- if False
- -- Disabled, see #7679, #8657
- -- ( gopt Opt_RegsGraph dflags
- -- || gopt Opt_RegsIterative dflags)
+ if ( gopt Opt_RegsGraph dflags
+ || gopt Opt_RegsIterative dflags )
then do
-- the regs usable for allocation
let (alloc_regs :: UniqFM (UniqSet RealReg))
diff --git a/docs/users_guide/using-optimisation.rst b/docs/users_guide/using-optimisation.rst
index 5e4995d..7047f4c 100644
--- a/docs/users_guide/using-optimisation.rst
+++ b/docs/users_guide/using-optimisation.rst
@@ -412,20 +412,26 @@ list.
.. ghc-flag:: -fregs-graph
- *Off by default due to a performance regression bug. Only applies in
- combination with the native code generator.* Use the graph colouring
- register allocator for register allocation in the native code
- generator. By default, GHC uses a simpler, faster linear register
- allocator. The downside being that the linear register allocator
- usually generates worse code.
+ :default: off due to a performance regression bug (:ghc-ticket:`7679`)
+
+ *Only applies in combination with the native code generator.* Use the graph
+ colouring register allocator for register allocation in the native code
+ generator. By default, GHC uses a simpler, faster linear register allocator.
+ The downside being that the linear register allocator usually generates
+ worse code.
+
+ Note that the graph colouring allocator is a bit experimental and may fail
+ when faced with code with high register pressure :ghc-ticket:`8657`.
.. ghc-flag:: -fregs-iterative
- *Off by default, only applies in combination with the native code
- generator.* Use the iterative coalescing graph colouring register
- allocator for register allocation in the native code generator. This
- is the same register allocator as the ``-fregs-graph`` one but also
- enables iterative coalescing during register allocation.
+ :default: off
+
+ *Only applies in combination with the native code generator.* Use the
+ iterative coalescing graph colouring register allocator for register
+ allocation in the native code generator. This is the same register allocator
+ as the :ghc-flag:`-fregs-graph` one but also enables iterative coalescing
+ during register allocation.
.. ghc-flag:: -fsimplifier-phases=<n>
More information about the ghc-commits
mailing list