Alternatives for representing a reverse postorder numbering

Sebastian Graf sgraf1337 at
Thu Dec 9 20:41:07 UTC 2021

FWIW, performance of IntMap could be even better if we had mutable fields and a transient (one with freeze/thaw conversion) interface.

We'd need a GHC with for that, though...

I think we could also speed up substitution by using a transient substitution type.
Von: ghc-devs <ghc-devs-bounces at> im Auftrag von Norman Ramsey <nr at>
Gesendet: Donnerstag, Dezember 9, 2021 8:16 PM
An: Andreas Klebinger
Cc: ghc-devs at
Betreff: Re: Alternatives for representing a reverse postorder numbering

> Which I guess mostly depends on how much mileage we get out of the
 > numbering... I rarely have lost sleep over the overhead of looking
 > things up in IntMaps.

Thank you!!  I found your analysis very helpful.  I will stick with
the IntMaps until and unless things reach a stage where they look
really ugly.

 > There is no invariant that Cmm control flow is reducible. So we
 > can't always rely on this being the case.

Good to know.  I would still like to have a simple Haskell example
that generates an irreducible control-flow graph, but for now I can
just write them by hand using .cmm files.

BTW *every* control-flow graph has at least one reverse-postorder
numbering, whether it is reducible or not.


ghc-devs mailing list
ghc-devs at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list