| OCR Text |
Show 61 Examination of the MC68020 code that the compiler generates shows that every conditional instruction is immediately preceeded by a CMP (compare) instruction. This means that only the condition code settings of the CMP instruction can affect the program behavior. Accordingly, optimizer 2 removes all conditional code settings except those of the CMP instruction. This strategy significantly reduces the simulation overhead for the test programs simple and tour In particular, the program simple, which was improved only slightly by optimizer 1, was almost twice as fast after optimizer 2 was applied to the behavioral modeling code. This is because the inner loop of the target code for simple consists of two short basic blocks : one exited via an unconditional jump, and one exited via a conditional jump. Optimizer 1 does not recognize that the condition code settings immediately before the unconditional jump are redundant. However, optimizer 2 removes the condition code settings in the unconditional block, since they are generated by an arithmetic operation (ADD) rather than an explicit compare (CMP). Optimizer 2 could not be applied to the "handcoded" H program because several of the conditional instructions in the program relied on the condition code setting of instructions other than the CMP instructions. Accordingly, the user must be careful when using optimizer 2, as it may lead to incorrect models. Data flow analysis of the condition code settings could be used to construct an efficient and correct optimizer. This is left as a possible future addition to the simulator. 4.2.2 Performance Model Overhead All three performance models (the "ticks" model, the "best case" model, and the "worst case" model) require the insertion of the same number of similiar statements into the behavioral modeling code. Hence, they all incur the same simulation overhead. Accordingly only one performance model was used to estimate the overhead of a combined behavioral and performance model. Examination of the timings for the performance model in Table 2 shows that the |