WW - Special case argument count restriction when dealing with products with a single field.
Motivation
{-# NOINLINE foo #-}
foo :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int
foo x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 =
x1 + x2+ x3+ x4+ x5+ x6+ x7+ x8+ x9+ x10+ x11
{-# NOINLINE bar #-}
bar :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int
bar x1 x2 x3 x4 x5 x6 x7 x8 =
x1 + x2+ x3+ x4+ x5+ x6+ x7+x8
Currently bar geht's a worker, foo does not.
The reason is reasonable. We want to avoid creating workers with countless arguments since at some point the overhead of more arguments outweighs the benefits of unboxing arguments.
For types like Int (and many others) the tradeoff at first, we avoid WW once the worker reached a certain number of arguments.
While this makes sense this isn't quite as sensible for types containing a single field.
Proposal
Ignore single field product types for the WW worker argument count restriction.
Possible downsides
Code duplication from inlining the wrapper.
Possible upsides
Constructors canceling each other out, removing allocation.
Better code when using -fdicts-strict. See !2575 (comment 251989)