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 {
1170
1170
return Ret;
1171
1171
}
1172
1172
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
+
1173
1191
bool AArch64TargetInfo::hasBFloat16Type () const {
1174
1192
return true ;
1175
1193
}
Original file line number Diff line number Diff line change @@ -107,6 +107,11 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
107
107
unsigned multiVersionSortPriority (StringRef Name) const override ;
108
108
unsigned multiVersionFeatureCost () const override ;
109
109
110
+ bool
111
+ initFeatureMap (llvm::StringMap<bool > &Features, DiagnosticsEngine &Diags,
112
+ StringRef CPU,
113
+ const std::vector<std::string> &FeaturesVec) const override ;
114
+
110
115
bool useFP16ConversionIntrinsics () const override {
111
116
return false ;
112
117
}
You can’t perform that action at this time.
0 commit comments