摘要 |
The inventive system and method separates the tracking of the loop entry and exit points and loop optimization information, from the generation of the instrumentation code at the loop entry and exit points. Thus, the different phases in the compiler can proceed in an optimal manner with respect to producing the best optimized code. This invention allows the correlation of the source code loops to the object code loops, even though different optimizations are being applied to loops. A loop information database is used to store a history of optimizations about loops, as well as loop entry and exit points, instead of using loop data structures that must be globally maintained. The invention detects the loops in the program code, and assigns a unique identifier to each detected loop. The entry and exit points, as well as the identifier are stored in the database. Any changes to the loops from optimizations are also stored in the database. This technique enables profilers to collect and report the profile information about loops to the user in an intelligible manner.
|