Hello,
(If you spend a lot of time looking at generated assembly you might
want to skip this one.)
As we all know the compiler's budget for optimizing C++ is an
implementation-defined metric where it knows best what is needed and
we are not supposed to be doing the compiler's job for it.
Unfortunately, this view has never really worked well in practice.
Recently I spent some time looking at the generated assembly from gcc
and clang and it doesn't look like the situation has improved in 30
years.
This is nonsense.
Optimizations like autovectorization and conditional devirtualization do lots that wasn't possible 30 years ago. A problem is that many programs are much bigger than they were 30 years ago.