Commit 6a5d13c4 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

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
parent 430f5c84
......@@ -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))
......
......@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment