[clang] [clang] [ARM] Explicitly enable NEON for Windows/Darwin targets (PR #122095)

David Spickett via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 4 05:32:26 PDT 2025


================
@@ -659,13 +659,21 @@ 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);
     }
+    if (Generic && (Triple.isOSWindows() || Triple.isOSDarwin()) &&
----------------
DavidSpickett wrote:

I don't see folks being very happy about backporting anything that would add a potentially breaking change, even if it does fix another issue in the process.

If you were to split out the ForAS change, would that be targeted enough to fix @anemet 's issue, or would that backport be just as impactful as https://github.com/llvm/llvm-project/pull/134366 ?

(we can more likely justify a "worse" fix on 20.x given that main will get a comprehensive fix)

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


More information about the cfe-commits mailing list