1. A compiler apparatus, which optimizes execution of a target program to be compiled by a multi-core processor, comprising: a recording section for recording the number of execution cores, which is the number of processor cores for execution of the target program, among processor cores included in the multi-core processor; a path detecting section for detecting a dominant path, which is a candidate of an execution path of one or more tasks to be consecutively executed by a single processor core, from the target program; a cluster generating section for selecting dominant paths with the number not larger than the number of execution cores, and for thereby generating clusters of tasks to be executed by a multi-core processor any one of in parallel and in a sequential manner; a time computing section for computing execution times for which each of the generated clusters is executed by the processor cores with the numbers equal to one or each of a plurality of natural numbers selected from the natural numbers not larger than the number of the execution cores; and a core number selecting section for selecting the number of the processor cores to be assigned for the execution of each of the generated clusters based on the computed execution times in order to reduce the total execution time of the target program.