INLINE pragmas

Joachim Breitner mail at joachim-breitner.de
Thu Jul 30 11:22:51 UTC 2015


Hi,

Am Donnerstag, den 30.07.2015, 13:10 +0200 schrieb Thomas Miedema:
> > INLINE[n]    becomes INLINEFROM[n]
> > NOINLINE[n]  becomes NOINLINEBEFORE[n]
> > INLINE[~n]   becomes INLINEBEFORE[n]
> > NOINLINE[~n] becomes NOINLINEFROM[n]
> 
> Still not great, because INLINE[n] doesn't inline before phase n 
> either. Maybe we should make that explicit, and use 2 separate 
> pragmas:
> 
> INLINE[n]    becomes NO_INLINE_BEFORE[n], INLINE_FROM[n]
> NOINLINE[n]  becomes NO_INLINE_BEFORE[n]
> INLINE[~n]   becomes NO_INLINE_FROM[n], INLINE_BEFORE[n]
> NOINLINE[~n] becomes NO_INLINE_FROM[n]
> 
> (a combination of NO_INLINE_BEFORE[n] and INLINE_BEFORE[n], or
>  NO_INLINE_FROM[n] and INLINE_FROM[n], would be an error)

I thought about that as well, but I can only fight it with more
verbosity:

INLINE[n]    becomes ONLY_INLINE_FROM[n]
NOINLINE[n]  becomes ONLY_NOINLINE_BEFORE[n]
INLINE[~n]   becomes INLINE_BEFORE[n]
NOINLINE[~n] becomes NOINLINE_FROM[n]

And I am not even sure if ONLY_INLINE_FROM has the connotation of
definite inlining to every reader...

> If that is too verbose, we could make the 'no inline' part implicit:
> 
> INLINE[n]    becomes INLINE_FROM[n]
> NOINLINE[n]  becomes INLINEABLE_FROM[n]
> INLINE[~n]   becomes INLINE_BEFORE[n]
> NOINLINE[~n] becomes INLINEABLE_BEFORE[n]

But INLINABLE has its own semantics (i.e. “do retain a copy of the
RHS”), and NOINLNE does, as far as I know, not imply this. But maybe
your idea works with

NOINLINE[n]  becomes MAY_INLINE_FROM[n]
NOINLINE[~n] becomes MAY_INLINE_BEFORE[n]

and if we have that, how about

INLINE[n]    becomes MUST_INLINE_FROM[n]
INLINE[~n]   becomes MUST_INLINE_BEFORE[n]

for symmetry as well?


We’ll get a nice bikeshed out of this!

Greetings,
Joachim

-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150730/58659a5b/attachment-0001.sig>


More information about the ghc-devs mailing list