decomp-permuter icon indicating copy to clipboard operation
decomp-permuter copied to clipboard

Specify control functions within a source file

Open abaresk opened this issue 2 years ago • 0 comments

Proposal

Add a mechanism for users to specify a list of control functions. If the source file contains a series of functions, one of which is the function to match (FTM), then a control function is any other function in the source file whose score must not decrease after permutations are applied.

This would be particularly useful for permutations that can affect other functions. Examples include struct nesting/flattening, changing types of globals, and changing types within function signatures. Here, the user could specify a list of control functions within the file that already match, and the permuter would discard any permutations that cause any control function to no longer match.

A potential optimization we can make is to only compile the FTM by default and only recompile control functions if an improvement is found.

Possible extension

Allow users to specify control functions across file boundaries. Users could include external files with control functions, and the permuter would check that the scores of those functions do not decrease. This is probably much more work, since right now the permuter is scoped to making changes within a single source file.

abaresk avatar Jun 22 '22 03:06 abaresk