[GHC] #11372: Loopification does not trigger for IO even if it could

GHC ghc-devs at haskell.org
Fri Jan 22 17:49:06 UTC 2016


#11372: Loopification does not trigger for IO even if it could
-------------------------------------+-------------------------------------
        Reporter:  jscholl           |                Owner:
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.3
  (CodeGen)                          |             Keywords:  cmm,
      Resolution:                    |  loopification, code generation
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D1767
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"4d51bfc8975f9c6c3ab6d293c48f98da85210d5f/ghc"
 4d51bfc8/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="4d51bfc8975f9c6c3ab6d293c48f98da85210d5f"
 Do not count void arguments when considering a function for loopification.

 This fixes #11372 by omitting arguments with a void-type when checking
 whether a self-recursive tail call can be optimized to a local jump.
 Previously, a function taking a real argument and a State# token
 would report an arity of 1 in the SelfLoopInfo in getCallMethod,
 but a self-recursive call would apply it to 2 arguments, one of them
 being the State# token, thus no local jump would be generated.
 As the State# token is not represented by anything at runtime, we can
 ignore it and thus trigger the loopification optimization.

 Test Plan: ./validate

 Reviewers: austin, bgamari, simonmar

 Reviewed By: bgamari

 Subscribers: simonmar, thomie

 Differential Revision: https://phabricator.haskell.org/D1767

 GHC Trac Issues: #11372
 }}}

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


More information about the ghc-tickets mailing list