Make sure forM_ and related functions fuse cleanly

Authored by sgraf on Sep 17 2018, 2:11 PM.

Description

Make sure forM_ and related functions fuse cleanly

Summary:
It was revealed in Trac #8763 that it's hard to come up with a list fusion
helper for efdtIntFB that doesn't duplicated occurrences of c,
which is crucial in guaranteeing that it is inlined.

Not inlining c led to spoiled join points, in turn leading to unnecessary
heap allocation. This patch tackles the problem from a different angle:
Fixing all consumers instead of the less often used producer
efdtIntFB by inserting an INLINE pragma in the appropriate places.
See https://ghc.haskell.org/trac/ghc/ticket/8763#comment:76 and the new
Note [List fusion and continuations in 'c'].

A quick run of NoFib revealed no regression or improvements whatsoever.

Reviewers: hvr, bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, carter

GHC Trac Issues: Trac #8763

Differential Revision: https://phabricator.haskell.org/D5131