-
Notifications
You must be signed in to change notification settings - Fork 6
Description
In Single-Path/SPScope.cpp, the order of blocks is decided by getBlocksTopoOrd. While this is a valid order, it is not always optimial, since there is no guarantee that the produced topological order minimizes the highest number of live predicates.
We should therefore implement a better block order algorithm that tries to minimize the highest number of live predicates. This should produce faster code, since less instructions are then needed for loading/spilling from the stack.
Additionally, the current topological sort is not deterministic (given the same program, the sort might be different for different compilations) probably because std::maps are used, whose keys are block addresses that change with every compile.
The new algorithm should be deterministic to make debugging easier.