[clang] [Clang][ARM] Ensure FPU Features are parsed when targeting `cc1as` (PR #134612)

David Green via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 10 05:03:53 PDT 2025


================
@@ -679,21 +679,17 @@ 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");
----------------
davemgreen wrote:

Is the isOSWindows || isOSDarwin if still needed and does it solve the issues reported for darwin?

If the point of this code is to work around an upstream patch in ubuntu, I'm wondering if that is better to address in the upstream ubuntu patch. Otherwise we get into a tug of war between their patch and the one here, which doesn't sound like the best solution. getARMCPUForArch already has some cpu overrides for different OS's.

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


More information about the cfe-commits mailing list