Commit Graph

9 Commits

Author SHA1 Message Date
Giacomo Vercesi a4ad571e61 rcc: Fix typos
Fix the typos detected by `codespell`
2023-05-11 10:04:32 +02:00
Andrea Gussoni ca540399d4 Ensure that no backedges are left
Ensure that no backedges are left after the restructuring of all the
metaregions.

This additional assertion should help ensuring that no entries in the
`Backedges` set are left after the restructuring process, in turn making
it easier to spot bugs if backedges references are not handled correctly
during the steps of the restructuring.
2023-01-31 11:55:52 +01:00
Andrea Gussoni db48424629 Handle Code and Collapsed node in shortest path
Assign a value to cloned and collapsed nodes in terms of shortest path
from entry, which is a criterion we use to elect region entry.
The shortest path is computed at the beginning for the nodes present in
the CFG, but needs to keep updated for additional nodes that we insert
that may become loop entry candidates.
2023-01-20 17:03:24 +00:00
Andrea Gussoni febd4a2777 Remove from Backedges set retreating edges
During the creation of the exit dispatcher, take care of removing from
the `Backedges` set the additional backedge that is collapsed in case
two exiting backedges do target the same destination.

When this is not done, a ghost backedge is left inside the set, making
it not coherent with the state of the graph.

In addition, we add an assertion which ensures that during this phase of
the restructuring dummy nodes are present only as source of retreating
edges, and have one and only one successor.
2023-01-20 17:02:18 +00:00
Pietro Fezzardi 5e12f66ffb Drop old logger, use CombLogger instead 2023-01-18 17:58:09 +01:00
Pietro Fezzardi a18cc9078f RestructureCFG.cpp: drop legacy removeFromRPOT
This can be replaced with concise idiomatic llvm::erase_value
2022-12-01 12:15:12 +01:00
Pietro Fezzardi 02bafadce7 RestructureCFG: new election of loop entry points
The new criterion for electing the entry point of a loop is based on the
number of edges that jump to the candidate entry from outside the
region.
2022-12-01 12:15:12 +01:00
Pietro Fezzardi c73b447c60 Use MFP in RegionCFG::inflate for reachable exits 2022-12-01 12:14:37 +01:00
Pietro Fezzardi 604d370239 Remove LLVM passes RestructureCFG, BeautifyGHAST
Now that the late stage of the decompilation pipeline is managed with
revng-pipeline, and we have a standalone tool for decompilation, we
have no need to use LLVM passes anymore for those stages.

This commit also renames the directories to avoid the confusing Pass
suffix, not what LLVM passes are gone.
2022-05-11 15:19:34 +02:00