Day 10 of Advent of Compiler Optimisations!
A simple loop summing 8 values — but tell the compiler the count is fixed at compile time and watch what happens. The code transforms in surprising ways. What does "unrolling" actually look like in assembly, and when does the compiler decide it's worth it? Try changing the count and see how the strategy changes!
Read more: https://xania.org/202512/10-loop-unrolling
Watch: https://youtu.be/HvF3tF2efEA