โŒ

Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Decompilation independent pattern structuring of cfg

I'm trying to learn on how to structure high level language flow structures and stumbled uppon an academic paper presenting a new way to structure a cfg without gotos.

I'm in a bit of a struggle understanding something fundamental as to how to even identify regions in the current procedure cfg. What I mean by this is given the example R1, R2, R3 regions in the paper:

enter image description here

identifying the R1 loop is easy with finding a back-edge node (c3) to the header (c1) but then how do you identify all blocks related to the loop?
If we just iterate the predecessors of the tail block (c3) then you'll miss on certain blocks for example n2 or n1.

Taking R2 as an example, how would you identify an acyclic region it?
I can assume one can check for a node (n7) with 2 predecessors (n5, n6) that are dominated by the same node (b1) and then going from the tail (n7) back to the header (b1) and collecting all the predecessors into the region, but I'm not sure if this will cover all edge cases.

I'm not sure what would be the way to identify all blocks related to a region reliably or how to even identify what is a region?

โŒ
โŒ