1. A method, comprising: analyzing source codes of a main thread to identify helper thread candidate code regions, the source codes including one or more code regions, each code region corresponding to a sequence of instructions representing an iteration loop in the source codes, the one or more code regions sharing at least one instruction in the source codes; estimating a communication cost based on potential benefit between the main thread and each code region; selecting a code region from the one or more code regions for one or more helper threads with respect to the main thread based on the communication cost; and generating codes for the one or more helper threads, the one or more helper threads being speculatively executed in parallel with the main thread to perform one or more tasks for the selected code region of the main thread.