Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature tracking bug.
The biggest performance cost presently is icache pressure. We should figure out techniques to improve icache performance as this has the potential for 2x performance gains.
First we need to hand-craft some experiments and possible solutions so we find a good path.
One idea is this:
One idea is to build new functions with generic input/outputs, then call those functions (basically reverse-inline). This will result in more instructions, but less code size which will typically be beneficial especially if no branches are used. One possible method:
Build a graph of common code and sights referencing that code. This will look though the existing statements and convert I/O to that statement to generic variables. The code at that point forms a potential function which references those variables generically. If the number of vars is small, hash the potential function, so we now have a function signature, and create a graph from the potential call sight to the potential function. Once the graph is built, find frequent common signatures, build a function corresponding signature, and replace the original logic with calls to that function.
Note Verilator presently has a V3Combine step that finds multiple functions with identical code and combines them into a single function, but this is very limited.