[clang] [llvm] [X86][APX] Remove CF feature from APXF and Diamond Rapids (PR #153751)

Alex Rønne Petersen via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 8 20:58:56 PST 2026


alexrp wrote:

I'm late to the party here, but I'm currently doing a cleanup/audit pass over Zig's CPU models and features, which are directly inherited from LLVM (with some adjustments).

Inaccurate modeling of hardware features has downstream consequences for us: We now have to make sure to add `cf` to every new CPU model that has the feature. If we don't, `-mcpu=novalake` disagrees with the result of `-mcpu=native` on such a CPU... unless, of course, we add a special case to `cpuid`-based detection that ignores `cf` for a set of known CPU models. But then that's just a goofy way of expressing what this should really be: A tuning feature applied to specific models. Surely this is a problem for LLVM's own `cpuid`-based detection too?

I'm up to my neck in CPU model and feature details right now, and off the top of my head, I can't think of a single other case where LLVM essentially lies about a CPU model's hardware features for tuning reasons.

> Done. CPU detection is not a problem either. All subfeatures under APXF share the same CPUID. They are more like tuning flags from this perspective :)

I mean, it sure sounds to me like what you actually want is an `apxf` feature and a bunch of tuning features built on top of it. I'm altogether very confused by how APX is currently being modeled in LLVM.

https://github.com/llvm/llvm-project/pull/153751


More information about the cfe-commits mailing list