2. The non-transitory computer readable storage media of claim 1 , wherein the method further comprises determining the cost of execution of the program with the conditional expression being moved to a move destination, wherein the cost of execution is based on a number of conditional statements corresponding to the inclusion relation, and a cost to access memory.
1. A non-transitory computer readable storage media having instructions stored thereon that, when executed by a computer, implement a method for optimizing if statements in a program, the method comprising: identifying a conditional expression having an inclusion relation corresponding to a plurality of conditional statements in the program, wherein a result of the conditional expression is representative of a result of the plurality of conditional statements respectively; and moving the conditional expression to a move destination in the program, wherein the move destination is determined by performing a data-flow analysis using expressions of positive and negative conditions of the conditional expression, and wherein moving the conditional expression comprises: in the case where a result of the conditional expression is not cached in a variable, generating an if statement for the conditional expression and caching a result of the conditional expression in a new variable, wherein the if statement is generated in increasing order of a cost of execution; and in the case where the result of the conditional expression is cached in the variable, replacing a conditional operator of the conditional expression with a logical operator, prior to caching the result in the new variable, in response to the result of the conditional expression being cached in a variable.