[GHC] #8971: Native Code Generator for 7.8 is not as optimized as 7.6.3...

GHC ghc-devs at haskell.org
Thu May 15 20:37:50 UTC 2014


#8971: Native Code Generator for 7.8 is not as optimized as 7.6.3...
--------------------------------------------+------------------------------
        Reporter:  GordonBGood              |            Owner:
            Type:  bug                      |           Status:  new
        Priority:  normal                   |        Milestone:  7.10.1
       Component:  Compiler (NCG)           |          Version:  7.8.1-rc2
      Resolution:                           |         Keywords:
Operating System:  Unknown/Multiple         |     Architecture:
 Type of failure:  Runtime performance bug  |  Unknown/Multiple
       Test Case:                           |       Difficulty:  Unknown
        Blocking:                           |       Blocked By:
                                            |  Related Tickets:
--------------------------------------------+------------------------------
Changes (by simonmar):

 * milestone:   => 7.10.1


Comment:

 I looked at this.  The short version is that this isn't going to be easy
 to fix, and I recommend using LLVM.

 The new code generator generates better code for let-no-escapes than the
 old code generator.  Whereas previously a let-no-escape would be a whole
 function with a fixed calling convention, with the new code generator it
 is just a label, and to call it we assign local variables for the
 arguments.  All things being equal, this is a better way to do things,
 because we're not fixing the arguments to particular registers, and we're
 giving the later phases more flexibility to optimise.

 However, the register allocator in our NCG isn't very good, particularly
 with loops, and it ends up doing a worse job with the new code than the
 old, even though previously most of the arguments were actually passed on
 the Haskell stack.  I don't think there are any easy tweaks to improve
 things, unfortunately.

 On 64-bit we get away with it because we have more registers.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8971#comment:17>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list