We were missing many feature flags that newer gcc supports and we had our own set of feature flags that gcc didnt' support that were overlapping. Clang's implementation assumes gcc's features list so a mismatch here is problematic.
I've also matched the cpu type/subtype lists with gcc and removed all the cpus that gcc doesn't support. I've also removed the fallback autodetection logic that was taken from Host.cpp. It was the main reason we had extra feature flags relative to gcc. I don't think gcc does this in libgcc.
Unfortunately, libgcc seems to have ignored their own source code comment and has added new cpu types/subtypes in the middle of their enums at various times so I can't guarantee any compatibility with older libgcc here. But maybe once we have a matching implementation we can treat that as a reason to file bugs against libgcc if they do it again going forward.
Once this support is in place we can consider implementing __builtin_cpu_is in clang. This could also be needed for function dispatching that Erich Keane is working on.