[clang] [Clang] Bring initFeatureMap back to AArch64TargetInfo. (PR #96832)

Tomas Matheson via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 27 09:04:54 PDT 2024


tmatheson-arm wrote:

The only thing `AArch64TargetInfo::initFeatureMap` adds is features from the selected CPU. IMHO this was not an appropriate place to be doing that. Since #94279 the CPU features are added either by `AArch64TargetInfo::parseTargetAttr` when dealing with `__attribute(target(...))`, and by `getAArch64ArchFeaturesFromMcpu` if you are in the clang driver dealing with `-mcpu`. Basically anywhere you see `AArch64::ExtensionSet::addCPUDefaults` used. This approach properly handles feature dependencies, which the old `AArch64TargetInfo::initFeatureMap` approach did not.

What inputs are you giving when you create the `TargetInfo`? What features do you expect to see that are missing? A concrete example would help to understand.

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


More information about the cfe-commits mailing list