Skip to content

Don't eta-expand unsaturated primops

Ben Gamari requested to merge wip/T16846 into master

Previously, as described in Note [Primop wrappers], hasNoBinding would return False in the case of PrimOpIds. This would result in eta expansion of unsaturated primop applications during CorePrep. Not only did this expansion result in unnecessary allocations, but it also meant lead to rather nasty inconsistencies between the CAFfy-ness determinations made by TidyPgm and CorePrep.

This fixes #16846 (closed).

In addition, I also refactor the consistentCafInfo assertion in CoreToStg to allow it to run in non-DEBUG compilers (enabled -dstg-lint). Given how subtle CAF issues are, it seems worthwhile to make this available to all compiler users.

Edited by Ben Gamari

Merge request reports