File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1170,6 +1170,24 @@ ParsedTargetAttr AArch64TargetInfo::parseTargetAttr(StringRef Features) const {
11701170 return Ret;
11711171}
11721172
1173+ bool AArch64TargetInfo::initFeatureMap (
1174+ llvm::StringMap<bool > &Features, DiagnosticsEngine &Diags, StringRef CPU,
1175+ const std::vector<std::string> &FeaturesVec) const {
1176+ std::vector<std::string> UpdatedFeaturesVec;
1177+ // Parse the CPU and add any implied features.
1178+ std::optional<llvm::AArch64::CpuInfo> CpuInfo = llvm::AArch64::parseCpu (CPU);
1179+ if (CpuInfo) {
1180+ auto Exts = CpuInfo->getImpliedExtensions ();
1181+ std::vector<StringRef> CPUFeats;
1182+ llvm::AArch64::getExtensionFeatures (Exts, CPUFeats);
1183+ for (auto F : CPUFeats) {
1184+ assert ((F[0 ] == ' +' || F[0 ] == ' -' ) && " Expected +/- in target feature!" );
1185+ UpdatedFeaturesVec.push_back (F.str ());
1186+ }
1187+ }
1188+ return TargetInfo::initFeatureMap (Features, Diags, CPU, UpdatedFeaturesVec);
1189+ }
1190+
11731191bool AArch64TargetInfo::hasBFloat16Type () const {
11741192 return true ;
11751193}
Original file line number Diff line number Diff line change @@ -107,6 +107,11 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
107107 unsigned multiVersionSortPriority (StringRef Name) const override ;
108108 unsigned multiVersionFeatureCost () const override ;
109109
110+ bool
111+ initFeatureMap (llvm::StringMap<bool > &Features, DiagnosticsEngine &Diags,
112+ StringRef CPU,
113+ const std::vector<std::string> &FeaturesVec) const override ;
114+
110115 bool useFP16ConversionIntrinsics () const override {
111116 return false ;
112117 }
You can’t perform that action at this time.
0 commit comments