Summary
You discovered the world of optimizations and the challenges you must solve when writing new optimizations. These challenges revolved around two concepts: legality and profitability. In the process, you learned about the helper structures that can be leveraged to build a cost model: something that can be used to reason about profitability.
Finally, you put all this knowledge into action by writing your own first optimization.
Your next stop is with the pass manager, where you will learn how to create a sequence of optimizations and reuse the existing ones. Before you go there, you have guessed it – it is quiz time!