[clang] [llvm] [ARM][Clang] Make `+nosimd` functional for AArch32 Targets (PR #130623)

Jack Styles via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 3 08:29:07 PDT 2025


================
@@ -679,20 +679,18 @@ llvm::ARM::FPUKind arm::getARMTargetFeatures(const Driver &D,
         CPUArgFPUKind != llvm::ARM::FK_INVALID ? CPUArgFPUKind : ArchArgFPUKind;
     (void)llvm::ARM::getFPUFeatures(FPUKind, Features);
   } else {
-    bool Generic = true;
-    if (!ForAS) {
-      std::string CPU = arm::getARMTargetCPU(CPUName, ArchName, Triple);
-      if (CPU != "generic")
-        Generic = false;
-      llvm::ARM::ArchKind ArchKind =
-          arm::getLLVMArchKindForARM(CPU, ArchName, Triple);
-      FPUKind = llvm::ARM::getDefaultFPU(CPU, ArchKind);
-      (void)llvm::ARM::getFPUFeatures(FPUKind, Features);
-    }
+    std::string CPU = arm::getARMTargetCPU(CPUName, ArchName, Triple);
+    bool Generic = CPU == "generic";
     if (Generic && (Triple.isOSWindows() || Triple.isOSDarwin()) &&
         getARMSubArchVersionNumber(Triple) >= 7) {
       FPUKind = llvm::ARM::parseFPU("neon");
       (void)llvm::ARM::getFPUFeatures(FPUKind, Features);
+    } else if ((!Generic) ||
----------------
Stylie777 wrote:

There was a change made in #122095 that ensured NEON was enabled for generic CPU's on those Triple's as this was not the case previously. Originally I had it as `else if (!Generic)` as having `!ForAS` is what was stopping the Driver from collecting the features from the FPU but I found it was not collecting all expected features for specific targets and tests were failing. Let me go back and try a different approach here to get it to be just (!Generic)

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


More information about the llvm-commits mailing list