These instructions are not supported by all CPUs in 64-bit mode. Emitting them causes Chromium to crash on start-up for users with those chips.
(GCC puts this behind -msahf on 64-bit for the same reason.)
This patch adds FeatureSAHF, enables it by default for 32-bit targets and modern CPUs, and changes X86InstrInfo::copyPhysReg back to the lowering from before r244503 when it's not available.
I'm not familiar with all the x86 CPU models, but I believe the ones I updated are all modern enough.
Please take a look.
I think this one could have it as well?