Skip to content

Draft: Make DataCon workers strict in strict fields (#20749)

Sebastian Graf requested to merge wip/T20749 into master

This patch tweaks exprIsConApp_maybe, exprIsHNF and frieds, and Demand Analysis so that they exploit and maintain strictness of DataCon workers. See Note [Strict fields in Core] for details.

Very little needed to change, and it puts field seq insertion done by Tag Inference into a new perspective: That of implementing strict field semantics. Before Tag Inference, DataCon workers are strict. Afterwards they are effectively lazy and field seqs happen around use sites. History has shown that there is no other way to guarantee taggedness and thus the STG Strict Field Invariant.

Unfortunately, T21392 does no longer reproduce after this patch, so I marked it as "not broken" in order to track whether we regress again in the future.

Fixes #20749, the satisfying conclusion of an annoying saga (cf. the ideas in #21497 (closed) and #22475 (closed)).

Merge request reports