Note [Bottoming bindings]

GHC/Core/Opt/Simplify/Iteration.hs:988 compiler 1 ticket

Suppose we have
   let x = error "urk"
   in ...(case x of <alts>)...
or
   let f = \y. error (y ++ "urk")
   in ...(case f "foo" of <alts>)...

Then we'd like to drop the dead <alts> immediately.  So it's good to
propagate the info that x's (or f's) RHS is bottom to x's (or f's)
IdInfo as rapidly as possible.

We use tryEtaExpandRhs on every binding, and it turns out that the
arity computation it performs (via GHC.Core.Opt.Arity.findRhsArity) already
does a simple bottoming-expression analysis.  So all we need to do
is propagate that info to the binder's IdInfo.

This showed up in #12150; see comment:16.

There is a second reason for settting  the strictness signature. Consider
   let -- f :: <[S]b>
       f = \x. error "urk"
   in ...(f a b c)...
Then, in GHC.Core.Opt.Arity.findRhsArity we'll use the demand-info on `f`
to eta-expand to
   let f = \x y z. error "urk"
   in ...(f a b c)...

But now f's strictness signature has too short an arity; see
GHC.Core.Opt.DmdAnal Note [idArity varies independently of dmdTypeDepth].
Fortuitously, the same strictness-signature-fixup code
gives the function a new strictness signature with the right number of
arguments.  Example in stranal/should_compile/EtaExpansion.

References 1

Referenced by 1