GNU Superoptimizer finds the shortest instruction sequence for a specific function. This project applies an innovative approach to solve the problem of optimizing code.
The algorithm used by the software has a time complexity of approximately 2n O(m n), where m represents the number of available instructions on the architecture and n is the shortest sequence for the end function. In most cases, the practical sequence length limit is around 5. However, for a rich instruction set like HPPA, the limit is only 4. The longest sequence ever generated by this software was for the MC68020 architecture, and it was 7 instructions long. It is important to note that generating this sequence took several weeks to complete.
Although the superoptimizer is designed to find the shortest instruction sequence for a given function, it cannot guarantee that it will always find the optimal solution. For example, the software doesn't include immediate constants other than -1, 0, +1, and the smallest negative and biggest positive numbers in sequences. Additionally, not all instructions are included, and some instructions are not correctly simulated. If you encounter any issues with the software or find incorrect sequences, please report them to the address below.
It is also essential to be aware of the potential for incorrect code sequences to be generated, although such occurrences are rare. It is imperative to verify that any generated sequence is correct before using it. Generally speaking, the superoptimizer can be relied upon to find optimal and correct sequences for functions that are dependent on registers only.
In the latest release of GNU Superoptimizer, some minor changes have been made. Unused variable tot_bits has been deleted, state1 now has a char type, and random() is now used on alpha. The update also improves the probability of small numbers being returned.
Version 2.5: N/A