Skip to content
  • Simon Peyton Jones's avatar
    No join-point from an INLINE function with wrong arity · a7dbafe9
    Simon Peyton Jones authored
    The main payload of this patch is NOT to make a join-point
    from a function with an INLINE pragma and the wrong arity;
    see Note [Join points and INLINE pragmas] in CoreOpt.
    This is what caused Trac #13413.
    
    But we must do the exact same thing in simpleOptExpr,
    which drove me to the following refactoring:
    
    * Move simpleOptExpr and simpleOptPgm from CoreSubst to a new
      module CoreOpt along with a few others (exprIsConApp_maybe,
      pushCoArg, etc)
    
      This eliminates a module loop altogether (delete
      CoreArity.hs-boot), and stops CoreSubst getting too huge.
    
    * Rename Simplify.matchOrConvertToJoinPoint
         to joinPointBinding_maybe
      Move it to the new CoreOpt
      Use it in simpleOptExpr as well as in Simplify
    
    * Define CoreArity.joinRhsArity and use it
    a7dbafe9