Generalized phase control for GHC

Roman Leshchinskiy rl at
Mon Jul 7 07:34:31 EDT 2008

Simon Peyton-Jones wrote:
> Ah -- Roman you mean you want to add a phase-ordering constraint at some time *other* than when you declare one or other of the phases.  Are you sure this is important?

Fairly. I've explained why in a follow-up to Max's message.

> Also, why do you want phase aliases?

Modularity. Let's take NDP fusion as an example. We have 2 logically 
distinct fusion phases, one for fusing distributed stuff and one for 
stream fusion (let's call the DIST and STREAM). At the moment, the two 
are performed simultaneously, i.e., we have DIST = STREAM. However, I 
suspect that having DIST < STREAM might produce better results. This 
means that I'd like to use INLINE DIST when implementing distributed 
fusion, INLINE STREAM for stream fusion and only have one place where I 
declare DIST = STREAM or DIST < STREAM. I don't quite see how to achieve 
this without aliases. This will be even more of a problem once I add 
additional fusion layers.

Incidentially, this is also an example of why adding ordering 
constraints on already declared phases is useful. Neither of the two 
fusion systems really depends on the other so it would be nice to be 
able to put the DIST < STREAM or DIST = STREAM declaration into a module 
which *integrates* the two.


More information about the Glasgow-haskell-users mailing list