How specific is hardware optimization when building from source and what should I look for in the documentation to decide if building for my hardware might be worth it?
From threads like this one I gather that optimization for my "CPU and environment" is a possible advantage, but that there are also risks. How does one know which optimizations are already standard and which ones I can benefit from with minimal risk? Compilation time and size of the binaries are not a priority.
What are the CPU optimizations tuned to? Specific models? AMD vs Intel? CPU generation? Chipset? Number of cores?
Are these optimizations overlapping or separate from optimization flags like O2 and O3?
Does the "environment" part of the optimization have to do with my kernel version, which libraries I have installed, or what? Is part of optimization deciding which libraries to build with?
If I stick to recommended flags, is there still some hardware optimization, or do I need to use the "riskier" flags? And are they still risky if I know exactly what hardware I will run the build on?
My understanding of O-flags is limited to having read that the higher O-numbers are more optimized but have a higher risk of instability. Do I need to be a software engineer in order to make educated guesses about flags?