
Thanks Mikolaj and Simon,
this explains it. I'll study the related ticket next. Still, the
floating-out related duplication aspect looks like a problem, or would
you disagree? I mean,
a) If the INLINE pragma is such a commandment, why don't we respect it with -O0?
b) Would it be sensible to only inline in scrutinee (`case <id> of
...`) context, to avoid duplication? After all it's the guts of the
value we are interested in, not the whole package.
c) Could a global CSE pass pick up the floated-out value and revert it
to the original imported identifier?
d) Or should be simply remove the INLINE pragmas from the library
(0-ary objects)? Possibly changing to INLINABLE?
Just thinking out loud, as this appears like a pessimisation to me.
Cheers,
Gabor
On 1/8/19, Mikolaj Konarski
On Tue, Jan 8, 2019 at 2:10 AM Gabor Greif
wrote: Hmm, yes. So why wasn't GHC 8.4 doing this? Did some commit fix the inliner to respect the pragma?
Yes: https://gitlab.haskell.org/ghc/ghc/commit/b9b1f99954e69f23e9647d00e048938d55...
But it's not on 8.6 branch (yet?).