Introduction
Imagine trying to avoid repeating the same calculation over and over in a program. Available expressions analysis helps find these repeated calculations so the computer can reuse results and run faster.
Imagine you are cooking and have already chopped some vegetables. If you know the chopped vegetables are still fresh and haven't been used or spoiled, you can reuse them in another dish without chopping again. But if you used or changed them, you need to chop fresh ones.
┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │ Block 1 │──────▶│ Block 2 │──────▶│ Block 3 │ │ Compute expr1 │ │ Compute expr2 │ │ Use expr1 & 2 │ └───────────────┘ └───────────────┘ └───────────────┘ │ │ ▲ │ │ │ └──────────────────────┴──────────────────────┘ Available expressions flow