This patch implements a different experimental code layout.
It has only been finished/tested for amd64.
Performance is slightly better (but within the margin of error)
on my machine. However compile times are definitely worse so
until there is something else which can take advantage of this
it's not worth implementing this fully.
Things this patch does:
- Move code responsilbe for block layout in it's own Module.
- Move the NcgImpl Class into NCGMonad.
- Extract a control flow graph from the input cmm.
- Update this cfg to keep it in sync with changes during asm codegen. I've only did the parts used by amd64 so this is definitely broken for x86 and likely broken on the other backends. Things that change the CFG are::
- Blocks added by the linear register allocator.
- Blocks added by the Cmm -> [Instr] translation.
- Assign weights to the edges in the CFG which are then used for block layout.