Parallel library

Simon Peyton Jones simonpj at microsoft.com
Thu Jul 30 10:14:00 UTC 2015


|  Ok, should it be INLINE[n] or NOINLINE[n], and what is the right value
|  of n?

Well it depends on the rules.  The offending ones are below

    libraries/parallel/Control/Parallel/Strategies.hs:513:2: warning:
        Rule "parList/rseq" may never fire
          because 'rseq' might inline first
        Probable fix: add an INLINE[n] or NOINLINE[n] pragma for 'rseq'
    
    libraries/parallel/Control/Parallel/Strategies.hs:582:1: warning:
        Rule "evalBuffer/rseq" may never fire
          because 'rseq' might inline first
        Probable fix: add an INLINE[n] or NOINLINE[n] pragma for 'rseq'
    
    libraries/parallel/Control/Parallel/Strategies.hs:583:1: warning:
        Rule "parBuffer/rseq" may never fire
          because 'rseq' might inline first
        Probable fix: add an INLINE[n] or NOINLINE[n] pragma for 'rseq'

All three appear to be always-active, and hence will run in the first phase (2).  So delaying inlining rseq to phase 1 (phases count downwards) would do.  So INLINE[1] or NOINLINE[1]

|  (I always have to look up the documentation for these, just a
|  suggestion but maybe it would be better to call them INLINEAFTER[n]
|  and INLINEBEFORE[n], or something?)

Maybe.  But NOINLINE[n] means "do not inline until phase n; and you are free to do what you like thereafter"  So it would have to be NOINLINEUNTIL[n].  But yes, that'd be quite do-able.

Simon

|  
|  Cheers
|  Simon


More information about the ghc-devs mailing list