Introduce `strictnessBarrier#` magic
This patch introduces a new strictnessBarrier# magic Id;
see Note [strictnessBarrier# magic].
This is a very useful and versatile primop, as it allows us to
- Demote the out-of-line primop
raiseIO#into an ordinary function, demystifying our notion of precise exception (raiseIO#is juststrictnessBarrier#+raise#). - Define
Control.Exception.evaluate2, which isControl.Exception.evaluatedone right, as discussed in #22935. - Demote that
seq#primop into a magic Id which is inlined in CorePrep, SeeNote [seq# magic]. This fixes #24124 (closed). In particular, doing so gets rid of much code and explanation in Tag Inference and StgToCmm.
I improved CorePrep a bit to better cope with the code left behind by inlining
seq#:
- I implemented a new
Note [Flatten case-bind]to get better code for otherwise nested case scrutinees. - I renamed the contructors of
ArgInfoto use anAIprefix in order to resolve the clash betweentype CpeApp = CoreExprand the data constructor ofArgInfo, as well as fixed typos inNote [CorePrep invariants]. Fixes #24252 (closed). - I documented that evaluation order is fixed after CorePrep in
Note [CorePrep invariants].
Fixes #24252 (closed) and #24124 (closed).
Currently there is an annoying bug relating to cached evaluation of shared work in GHCi. I'm completely puzzled; !11515 (closed) did not have it.