摘要 |
PROBLEM TO BE SOLVED: To provide a method for comprehensively and automatically generating a prefetch instruction when a cache state includes three states: "having no data; for loading; and for both loading and storage", and to provide a compiler. SOLUTION: The method for generating the prefetch instruction of the compiler includes: a step of specifying as an optimization target a loading instruction for causing a cache to transition from a state having no data to a state suitable for loading among instructions included in an area to be optimized and a storage instruction for causing the cache to transition from a state suitable for loading to a state suitable for loading and storage among the instructions included in the area to be optimized, for each of one or more areas to be optimized constituting a source program being a compile target; and a step of determining a position for inserting a prefetch instruction in the area to be optimized on the basis of the specified optimization target and a branch probability of each if sentence included in the source program, and generating the prefetch instruction at the position. COPYRIGHT: (C)2010,JPO&INPIT |