Skip to content

Loop statistics in comments #18

@rasky

Description

@rasky

It would be nice to get the following statistics in loops or all blocks (as a comment on the label line, in the generated asm code):

• Total cycle count of the loop
• Number of SUs and VUs in the loop
• Density factor, which is the proportion between the total cycle count and the number of cycles in which two paired instructions run (so excluding stalls, and excluding nops)

The density factor is 1 only if all instructions in the loop are paired (impossible since at least the final branch's delay slot can't be paired). Any nop, any non paired instruction and any stall decrease it.

The density factor gives an idea of how much code you can (potentially) add to the loop without affecting its performance. For instance, if a loop has density factor 0.98, probably we can't add much to it without slowing it down. If the density factor is low, the raw counts of VUs and SUs give a rough idea on where we should focus, and possibly also what code changes to do that might increase the density (the ones that eventually RSPL could attempt by itself, see #8).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions