Patent ID: 8468511

Claim:
A computer-implemented method for optimizing a program comprising a plurality of functions, and wherein the computer-implemented method comprises: receiving a determination, as a result of an interprocedural analysis, that the program can benefit from an optimization technique that requires breaking a calling convention of an operating system loaded on a computer on which the program will be executed after optimization, wherein a scope of interprocedural analysis is defined by an interaction between a first function and a second function, wherein the first function and the second function use a same set of registers; optimizing the program using the optimization technique, wherein the calling convention is broken during optimizing, and wherein the first function in the plurality of functions is modified as a result of optimizing; mangling a name of the first function, wherein mangling comprises changing the name, wherein a unique first mangled name is formed, wherein the unique first mangled name includes, as a result of mangling, first information including an indication of a calling convention used and an incoming register and outgoing register usage conveying at least in part how the first function was modified, wherein a compilation tool can, after optimizing, use the first information to take a first action with respect to the first function, and wherein the compilation tool would otherwise require the calling convention to remain unbroken in order to take the first action; and responsive to the second function in the plurality of functions being a caller of the first function, modifying the second function to correctly invoke the first function using the unique first mangled name wherein the modifying allows the first information passed in the unique first mangled name to be used to correctly process the broken calling convention of the first function.