WW can result in less inlining.
Summary
While looking at !2575 (closed) I realized that WW can decrease the likelihood of a function being fully inlined.
Which in turn might end up introducting higher order calls when they were known calls before or other undesireable things.
Consider these two functions, one with a strict dictionary.
data Dict = Dict { method :: (Char -> Bool) }
myFunction :: Num a => ((Char -> Bool) -> (a -> a) -> t1 -> t2 -> t3) -> Dict -> t1 -> t2 -> t3
myFunction f dict a b = f (method dict) (\x -> x+1) a b
myWWedFunction :: Num a => ((Char -> Bool) -> (a -> a) -> t1 -> t2 -> t3) -> (Char -> Bool) -> t1 -> t2 -> t3
myWWedFunction f method a b = f method (\x -> x+1) a b
For the original variant we get guidance of Guidance=IF_ARGS [60 60 20 0 0] 150 0}]
For the worker of myWWedFunction
it's Guidance=IF_ARGS [60 60 0 0 0] 140 0}]
While the size of the worker decreased by 10, the discount for a evaluated dictionary argument also decreased by 20. This means it's overall less likely for the function to be inlined if WW is applied to the dictionary.
WW is clearly beneficial in this case. But it's somewhat annoying that it might make performance worse down the line.
Maybe we could give a discount if inlining turn unknown into known calls.