diff options
author | Sander de Smalen <sander.desmalen@arm.com> | 2025-07-01 10:20:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-01 10:20:40 +0100 |
commit | cd10ded697878b0a10b65fbcd2a8f9387bdbf2b7 (patch) | |
tree | f70e0fa5059bb03fa451ea2ffa9512a8d569cc25 /clang/lib/Basic | |
parent | a6bb895efe47c56d99556c38172e554fb6a9110c (diff) | |
download | llvm-cd10ded697878b0a10b65fbcd2a8f9387bdbf2b7.zip llvm-cd10ded697878b0a10b65fbcd2a8f9387bdbf2b7.tar.gz llvm-cd10ded697878b0a10b65fbcd2a8f9387bdbf2b7.tar.bz2 |
[Clang] Remove AArch64TargetInfo::setArchFeatures (#146107)
When compiling with `-march=armv9-a+nosve` we found that Clang still
defines the `__ARM_FEATURE_SVE2` macro, which is explicitly set in
`setArchFeatures` when compiling for armv9-a.
After some experimenting, I found out that the list of features passed
into `AArch64TargetInfo::handleTargetFeatures` has already been expanded
and takes into account `+no[feature]` and has already expanded features
like `armv9-a`.
From that I conclude that `setArchFeatures` is no longer required.
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r-- | clang/lib/Basic/Targets/AArch64.cpp | 74 | ||||
-rw-r--r-- | clang/lib/Basic/Targets/AArch64.h | 2 |
2 files changed, 0 insertions, 76 deletions
diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp index 124b340..e57feafe 100644 --- a/clang/lib/Basic/Targets/AArch64.cpp +++ b/clang/lib/Basic/Targets/AArch64.cpp @@ -125,79 +125,6 @@ static constexpr auto BuiltinAArch64Infos = #include "clang/Basic/BuiltinsAArch64.def" }); -void AArch64TargetInfo::setArchFeatures() { - if (*ArchInfo == llvm::AArch64::ARMV8R) { - HasDotProd = true; - HasDIT = true; - HasFlagM = true; - HasRCPC = true; - FPU |= NeonMode; - HasCCPP = true; - HasCRC = true; - HasLSE = true; - HasRDM = true; - } else if (ArchInfo->Version.getMajor() == 8) { - if (ArchInfo->Version.getMinor() >= 7u) { - HasWFxT = true; - } - if (ArchInfo->Version.getMinor() >= 6u) { - HasBFloat16 = true; - HasMatMul = true; - } - if (ArchInfo->Version.getMinor() >= 5u) { - HasAlternativeNZCV = true; - HasFRInt3264 = true; - HasSSBS = true; - HasSB = true; - HasPredRes = true; - HasBTI = true; - } - if (ArchInfo->Version.getMinor() >= 4u) { - HasDotProd = true; - HasDIT = true; - HasFlagM = true; - } - if (ArchInfo->Version.getMinor() >= 3u) { - HasRCPC = true; - FPU |= NeonMode; - } - if (ArchInfo->Version.getMinor() >= 2u) { - HasCCPP = true; - } - if (ArchInfo->Version.getMinor() >= 1u) { - HasCRC = true; - HasLSE = true; - HasRDM = true; - } - } else if (ArchInfo->Version.getMajor() == 9) { - if (ArchInfo->Version.getMinor() >= 2u) { - HasWFxT = true; - } - if (ArchInfo->Version.getMinor() >= 1u) { - HasBFloat16 = true; - HasMatMul = true; - } - FPU |= SveMode; - HasSVE2 = true; - HasFullFP16 = true; - HasAlternativeNZCV = true; - HasFRInt3264 = true; - HasSSBS = true; - HasSB = true; - HasPredRes = true; - HasBTI = true; - HasDotProd = true; - HasDIT = true; - HasFlagM = true; - HasRCPC = true; - FPU |= NeonMode; - HasCCPP = true; - HasCRC = true; - HasLSE = true; - HasRDM = true; - } -} - AArch64TargetInfo::AArch64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) : TargetInfo(Triple), ABI("aapcs") { @@ -1266,7 +1193,6 @@ bool AArch64TargetInfo::handleTargetFeatures(std::vector<std::string> &Features, } setDataLayout(); - setArchFeatures(); if (HasNoFP) { FPU &= ~FPUMode; diff --git a/clang/lib/Basic/Targets/AArch64.h b/clang/lib/Basic/Targets/AArch64.h index 1951e06..56adfa9 100644 --- a/clang/lib/Basic/Targets/AArch64.h +++ b/clang/lib/Basic/Targets/AArch64.h @@ -158,8 +158,6 @@ public: return false; } - void setArchFeatures(); - void getTargetDefinesARMV81A(const LangOptions &Opts, MacroBuilder &Builder) const; void getTargetDefinesARMV82A(const LangOptions &Opts, |