Skip to content

Single-path: Optimize block placement #1

@Emoun

Description

@Emoun

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions