Refactoring in CoreUtils/CoreArity
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 27 Apr 2012 15:28:02 +0000 (16:28 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 27 Apr 2012 15:28:02 +0000 (16:28 +0100)
commite3f8557c2aca04cf64eec6a1aacde6e01c0944ff
tree1ea137e7dd39694e37070661cea0744f9ab594ac
parent745ec959ff647c3a455767d20f6f37e9a0cc65aa
Refactoring in CoreUtils/CoreArity

In the previous commit about "aggressive primops" I wanted a new
function CoreUtils.exprCertainlyTerminates.  In doing this I ended up
with a significant refactoring in CoreUtils.  The new structure has
quite a lot of nice sharing:

         exprIsCheap             = exprIsCheap' isHNFApp
         exprIsExpandable        = exprIsCheap' isConLikeApp

         exprIsHNF               = exprIsHNFlike isHNFApp
         exprIsConLike           = exprIsHNFlike isConLikeApp
         exprCertainlyTerminates = exprIsHNFlike isTerminatingApp

This patch also does some renaming

    CheapAppFun      -->   FunAppAnalyser
    isCheapApp       -->   isHNFApp
    isExpandableApp  -->   isConLikeApp
compiler/coreSyn/CoreArity.lhs
compiler/coreSyn/CoreUtils.lhs
compiler/simplCore/OccurAnal.lhs
compiler/simplCore/SimplUtils.lhs
compiler/simplCore/Simplify.lhs