================
@@ -340,14 +340,22 @@ void AArch64::ExtensionSet::disable(ArchExtKind E) {
       disable(Dep.Later);
 }
 
+static void setEnableIfMandatory(AArch64::ExtensionSet &Exts,
+                                 AArch64::ExtensionInfo E) {
+  if (Exts.BaseArch->DefaultExts.test(E.ID))
+    Exts.Enabled.set(E.ID);
+}
+
 void AArch64::ExtensionSet::addCPUDefaults(const CpuInfo &CPU) {
   LLVM_DEBUG(llvm::dbgs() << "addCPUDefaults(" << CPU.Name << ")\n");
   BaseArch = &CPU.Arch;
 
   AArch64::ExtensionBitset CPUExtensions = CPU.getImpliedExtensions();
-  for (const auto &E : Extensions)
+  for (const auto &E : Extensions) {
     if (CPUExtensions.test(E.ID))
       enable(E.ID);
+    setEnableIfMandatory(*this, E);
----------------
tommat01 wrote:

I think the order is important here because the bitset is tracking whether each 
bit gets touched, and currently the arch defaults remain "untouched" but are 
interleaved with the cpu defaults which are "touched" (via `enable()`). It 
might make more sense to set the base arch defaults before adding the cpu 
defaults. In a separate loop before this sloop.

https://github.com/llvm/llvm-project/pull/203458
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to