9.6 Loops in Flow Graphs
In our discussion so far, loops have not been handled differently; they have been treated just like any other kind of control flow. However, loops are important because programs spend most of their time executing them, and optimizations that improve the performance of loops can have a significant impact. Thus, it is essential that we identify loops and treat them specially.
Loops also affect the running time of program analyses. If a program does not contain any loops, we can obtain the answers to data-flow problems bymaking just one pass through the program. For example, a forward data-flow problem can be solved by visiting all the nodes once, in topological order.
In this section, we introduce the following concepts: ...
Get Compilers: Principles, Techniques, and Tools, Updated 2nd Edition by Pearson now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.