摘要 |
<p>In an optimizer (100), a method (300) is applied to detect equivalent instruction sequences in a software program (500) written in assembly language. The optimizer (100) loads the program (310), establishes a tree structure (320) and identifies isomorphic Single-Entry-Single-Exit (SESE) structures (330). SESEs are isomorphic when they have: (a) equal level within the tree and (b) an equal number of sub-SESEs. Then, the optimizer (100) assigns alphabet elements (130, e.g., 'a', 'b', 'c') to program instructions (550) and lists the elements according to their occurrences (140). In repetitions, optimizer (100) detects multiple occurring elements combinations (e.g., (a, b)) and skips uniquely occurring elements. The multiple occurring elements combinations represent the equivalent instruction sequences and form the input information for further modifying the program (350).</p> |