Skip to content
  • Jonas Scholl's avatar
    Do not count void arguments when considering a function for loopification. · 4d51bfc8
    Jonas Scholl authored and Ben Gamari's avatar Ben Gamari committed
    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
    4d51bfc8