[clang] [llvm] [AArch64] Add support for -mcpu=gb10. (PR #146515)
Ricardo Jesus via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 1 08:48:51 PDT 2025
================
@@ -179,22 +179,39 @@ StringRef sys::detail::getHostCPUNameForARM(StringRef ProcCpuinfoContent) {
// Look for the CPU implementer line.
StringRef Implementer;
StringRef Hardware;
- StringRef Part;
+ SmallVector<StringRef, 32> Parts;
for (unsigned I = 0, E = Lines.size(); I != E; ++I) {
if (Lines[I].starts_with("CPU implementer"))
Implementer = Lines[I].substr(15).ltrim("\t :");
if (Lines[I].starts_with("Hardware"))
Hardware = Lines[I].substr(8).ltrim("\t :");
if (Lines[I].starts_with("CPU part"))
- Part = Lines[I].substr(8).ltrim("\t :");
+ Parts.emplace_back(Lines[I].substr(8).ltrim("\t :"));
}
+ // Last `Part' seen, in case we don't analyse all `Parts' parsed.
+ StringRef Part = Parts.empty() ? StringRef() : Parts.back();
+
+ // Remove duplicate `Parts'.
----------------
rj-jesus wrote:
There will be multiple CPU part lines in `/proc/cpuinfo` based on the number of cores of the system (not one line per _unique_ core type), so we need to filter out duplicates.
https://github.com/llvm/llvm-project/pull/146515
More information about the llvm-commits
mailing list