Patent ID: 7398522

Claim:
A compilation method for collecting frequencies with which each process is executed in a program to be optimized and optimizing said program based on the collected frequencies, said method having: a loop process detection step of detecting a repeatedly executed loop process of said program; a loop process frequency collection step of collecting loop process frequencies with which said loop process is executed in said program; an in-loop process frequency collection step of collecting in-loop process frequencies with which, as against the number of times of execution of said loop process, each of a plurality of in-loop processes included in said loop process is executed; an in-loop execution information generating step of, based on said loop process frequencies and said in-loop process frequencies, generating in-loop execution information indicating the frequencies with which each of said plurality of in-loop processes is executed in the case where said program is executed; and an optimization step of optimizing said program based on said in-loop execution information generated by said in-loop execution information generating portion, the in-loop executing information generating step further determining whether said loop process frequencies are higher than a predetermined reference frequency, and determining number of times of execution of said each of a plurality of in-loop processes.