Patent ID: 7458065

Claim:
A method, comprising: determining, for a target processor having a plurality of thread units, a predicted sequential execution time for a sequence of program instructions; selecting a first speculative thread from a set of potential candidates, wherein the set of potential candidates further comprises a set of candidate spawning pairs, where each spawning pair indicates a spawn point and a target point for one of the candidates modeling a first predicted multithreaded execution time for the sequence of program instructions, wherein said modeling further includes modeling an effect of concurrent execution of the first speculative thread on the sequential execution time; responsive to determining that the first predicted multithreaded execution time is less than the predicted sequential execution time, selecting the first speculative thread; modeling a second predicted multithreaded execution time for the sequence of program instructions, the second predicted multithreaded execution time to include an effect of a second concurrent speculative thread on the sequential execution time; selecting the second speculative thread, and de-selecting the first speculative thread, if the second predicted multithreaded execution time is less than the first predicted multithreaded execution time; and generating a binary file corresponding to the sequence of program instructions, where the binary file includes a spawn instruction for the selected speculative thread.