spo600:compiler_optimizations
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
spo600:compiler_optimizations [2024/10/08 17:52] – chris | spo600:compiler_optimizations [2025/02/06 03:44] (current) – [Examples of Common Optimizations] chris | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Compiler Optimizations | ===== Compiler Optimizations | ||
- | //Compiler optimizations// | + | //Compiler optimizations// |
===== Why It's Important to Understand Compiler Optimizations ===== | ===== Why It's Important to Understand Compiler Optimizations ===== | ||
Line 21: | Line 21: | ||
===== LLVM Optimization Options | ===== LLVM Optimization Options | ||
- | LLVM can perform an extensive set of analysis and transform operations (optimizations). See the llvm documentation for details. | + | LLVM, an alternative open source compiler project, |
===== Examples of Common Optimizations | ===== Examples of Common Optimizations | ||
Line 29: | Line 29: | ||
Important notes: | Important notes: | ||
* There are many other kinds of optimizations, | * There are many other kinds of optimizations, | ||
- | * Many of these optimizations cannot be performed when code has a side effect -- for example, the direction of a loop can sometimes be reversed without impact if the loop contains only calculations, | + | * Many of these optimizations cannot be performed when code has a side effect -- for example, the direction of a loop can sometimes be reversed without impact if the loop contains only calculations, |
* To make decisions on whether to apply some specific optimizations, | * To make decisions on whether to apply some specific optimizations, | ||
* Many optimization decisions are based on a cost-benefit analysis. For example, optimizations such as loop unrolling will often increase performance at the cost of larger code size. In some cases, the usage pattern of the code, such as loop counts and procedure call frequency, is relevant to optimization decisions. [[Profile-Guided Optimization|Profile-Guided Optimization (PGO)]] can assist in making these determinations. | * Many optimization decisions are based on a cost-benefit analysis. For example, optimizations such as loop unrolling will often increase performance at the cost of larger code size. In some cases, the usage pattern of the code, such as loop counts and procedure call frequency, is relevant to optimization decisions. [[Profile-Guided Optimization|Profile-Guided Optimization (PGO)]] can assist in making these determinations. |
spo600/compiler_optimizations.1728409964.txt.gz · Last modified: 2024/10/08 17:52 by chris