Also, something being NP complete does not say much about whether it is hard to do in the real world. Exponential is fine, as long as the constant, the value of n, or the exponent aren&#x27;t too large.<p>Here, real world cases likely will have only a fairly limited number of registers and only a limited (but potentially very long) length of code to optimize across.<p>It would be interesting (and quite an accomplishment, even if doesn&#x27;t give significant performance gains) to combine this with whole-program optimization (imagine optimizing the calling conventions on a per-function basis, and considering generating code for a function twice, with different calling conventions) and&#x2F;or with the code that decides what functions to inline, but AFAIK, nobody does that.