PURPOSE: To optimize a loop by a compiler for architecture having a function for invalidating the execution result of a previously executed instruction in accordance with judgement whether branching is to be executed by a succeeding condition branch or not.
CONSTITUTION: A loop conversion selecting part 107 in a loop optimizing part 104 determines a loop converting method, and when an instruction for using an invalidating function is usable, a loop conversion executing part 108 converts a loop using the instruction to optimize the loop. Consequently the number of instructions or the number of registers to be used can be reduced without losing a convensional loop conversion effect, and even when the repeated frequency of the loop is not determined at the time of starting the loop, loop conversion can be executed.
TOYAMA KEISUKE