A method for relating profile data collected during execution of an optimized computer program back to the source-language description of the computer program, the optimized computer program including actual line numbers associated with each intermediate code instruction and logical line numbers associated with each basic block within the intermediate code program, the method comprising:
- accumulating profile data by storing and incrementing counts associated with execution of branch instructions, each execution of a branch instruction transferring control to a particular target instruction, and each count associated with one particular branch instruction and one particular target instruction;
- and
- relating each accumulated count to the actual line number of the branch instruction associated with the count and the logical line number of the basic block that contains the target instruction associated with the count.