Simon Peyton Jones pushed to branch wip/T26548 at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Core/Opt/Simplify/Utils.hs
    ... ... @@ -1032,7 +1032,7 @@ interestingArg env e = go env 0 e
    1032 1032
            | n > 0         = NonTrivArg -- Saturated or unknown call
    
    1033 1033
            | otherwise  -- n==0, no value arguments; look for an interesting unfolding
    
    1034 1034
            = case idUnfolding v of
    
    1035
    ---           OtherCon [] -> NonTrivArg   -- It's evaluated, but that's all we know
    
    1035
    +           OtherCon [] -> TrivArg      -- It's evaluated, but that's all we know
    
    1036 1036
                OtherCon _  -> NonTrivArg   -- Evaluated and we know it isn't these constructors
    
    1037 1037
                   -- See Note [OtherCon and interestingArg]
    
    1038 1038
                DFunUnfolding {} -> ValueArg   -- We konw that idArity=0
    
    ... ... @@ -1046,13 +1046,16 @@ interestingArg env e = go env 0 e
    1046 1046
     {- Note [OtherCon and interestingArg]
    
    1047 1047
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    1048 1048
     interstingArg returns
    
    1049
    -   (a) NonTrivArg for an arg with an OtherCon [] unfolding
    
    1050
    -   (b) ValueArg for an arg with an OtherCon [c1,c2..] unfolding.
    
    1049
    +   (a) TrivArg for an arg with an OtherCon [] unfolding
    
    1050
    +   (b) NonTrivArg for an arg with an OtherCon [c1,c2..] unfolding.
    
    1051 1051
     
    
    1052
    -Reason for (a): I found (in the GHC.Internal.Bignum.Integer module) that I was
    
    1053
    -inlining a pretty big function when all we knew was that its arguments
    
    1054
    -were evaluated, nothing more.  That in turn make the enclosing function
    
    1055
    -too big to inline elsewhere.
    
    1052
    +Reason for (a):
    
    1053
    +  I found (in the GHC.Internal.Bignum.Integer module) that I was
    
    1054
    +  inlining a pretty big function when all we knew was that its arguments
    
    1055
    +  were evaluated, nothing more.  That in turn make the enclosing function
    
    1056
    +  too big to inline elsewhere.
    
    1057
    +
    
    1058
    +  
    
    1056 1059
     
    
    1057 1060
     Reason for (b): we want to inline integerCompare here
    
    1058 1061
       integerLt# :: Integer -> Integer -> Bool#