Note [Fast path for lazy data constructors]

GHC/Core/Opt/Simplify/Iteration.hs:2221 compiler

For applications of a /lazy/ data constructor worker, the full glory of
rebuildCall is a waste of effort;
* They never inline, obviously
* They have no rewrite rules
* Lazy constructors don't need the `StrictArg` treatment.
So it's fine to zoom straight to `rebuild` which just rebuilds the
call in a very straightforward way.

For a data constructor worker that is strict (see Note [Strict fields in Core])
we take the slow path, so that we'll transform
  K (case x of (a,b) -> a)  -->   case x of (a,b) -> K a
via the StrictArg case of rebuildCall

Some programs have a /lot/ of data constructors in the source program
(compiler/perf/T9961 is an example), so this fast path can be very
valuable.

References 1

Referenced by 1