[commit: ghc] master: nativeGen: Allow -fregs-graph to be used (6a5d13c)

git at git.haskell.org git at git.haskell.org
Thu Jun 30 17:58:27 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6a5d13c4ade5bbb84873970065a1acd1546f6c31/ghc

>---------------------------------------------------------------

commit 6a5d13c4ade5bbb84873970065a1acd1546f6c31
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


>---------------------------------------------------------------

6a5d13c4ade5bbb84873970065a1acd1546f6c31
 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 2bf9e1c..094a908 100644
--- a/compiler/nativeGen/AsmCodeGen.hs
+++ b/compiler/nativeGen/AsmCodeGen.hs
@@ -535,10 +535,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 9436510..6b58093 100644
--- a/docs/users_guide/using-optimisation.rst
+++ b/docs/users_guide/using-optimisation.rst
@@ -419,20 +419,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