Hi Richard ! So in my discovery of TCG, one thing I noticed is the horrendous amount of code generated for branches, especially conditional ones.
I have a patch at least to remove a bunch of dead gunk on target-ppc for non-conditional ones (we still generated the "else" of the condition even when never branching to it). However, I wonder if there are ways to do better. The first obvious thing that comes to mind is to avoid stopping the TB on a non-taken conditional branch. The reason that can't be done today, from my limited understanding of things, is because we only support index 0 and 1 today for gen_goto_tb(). Now I haven't completely figured out how TB linkage works under the hood but do you know of any fundamental reason why we have that limit ? Could we, for example, have a limit of, for example, 8 and only break the TB after a branch if we have less than 2 left ? Or are there deeper reasons why we really can't link more than 2 ? With the current implementation, a non-taken branch results in three branches: One to "skip over" the condition-true case, one to the new TB and one in the header of that new TB to check for exits. We could reduce to one in most cases. Cheers, Ben.