I co-wrote a tour of some recent MSVC backend improvements!
Have a look for some before-and-after assembly samples and more details.
https://devblogs.microsoft.com/cppblog/a-tour-of-4-msvc-backend-improvements/
I co-wrote a tour of some recent MSVC backend improvements!
Have a look for some before-and-after assembly samples and more details.
https://devblogs.microsoft.com/cppblog/a-tour-of-4-msvc-backend-improvements/
One is a bit tracker which can recognise custom byteswap functions and optimise down to bswap
Before > After
Another is loop unswitching, which tries to avoid unnecessary branching based on invariant conditions in loops.
It basically does the equivalent of translating the 1st C++ sample into the 2nd one
Next is better codegen for min/max chains.
Given the 1st C++ sample, the compiler used to generate what's in the 2nd pic. Now it generates the 3rd.