Open l-kent opened 8 months ago
The analysis also needs to be updated to add conditions to the jumps to the new header block, so that the original control flow is maintained. This is a crucial part of the original algorithm that is missing from the current implementation.
The irreducible loops analysis should be based around Block and not CFGPosition, as it only cares about loops internally within a procedure, where blocks are the only relevant control flow nodes. This would be significantly clearer and more efficient.
It may also be useful to split it out and give it a separate flag rather than having all the analyses bundled under the
--analyse
flag now that the number of analyses is increasing? Finer-grained control over which analyses are run would be generally useful, though it would need to make note of the dependencies between them.