[llvm] [RISCV] Map spacemit uarch strings to CPU names in host detection (PR #207636)

Mark Zhuang via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 7 23:53:42 PDT 2026


https://github.com/zqb-all updated https://github.com/llvm/llvm-project/pull/207636

>From 22c9217876b0859d801d5c1b43f78f10067f7019 Mon Sep 17 00:00:00 2001
From: Mark Zhuang <mark.zhuang at spacemit.com>
Date: Sun, 5 Jul 2026 10:38:52 +0800
Subject: [PATCH] [RISCV] Map spacemit uarch strings to CPU names in host
 detection

-mcpu/-mtune=native first tries hwprobe; when that yields no usable
CPU model it falls back to the cpuinfo uarch line. Add spacemit,x60/
x100/a100 there.
---
 llvm/lib/TargetParser/Host.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/llvm/lib/TargetParser/Host.cpp b/llvm/lib/TargetParser/Host.cpp
index b5fe1b9e7560c..557b7eb151b48 100644
--- a/llvm/lib/TargetParser/Host.cpp
+++ b/llvm/lib/TargetParser/Host.cpp
@@ -567,6 +567,9 @@ StringRef sys::detail::getHostCPUNameForRISCV(StringRef ProcCpuinfoContent) {
       .Case("eswin,eic770x", "sifive-p550")
       .Case("sifive,u74-mc", "sifive-u74")
       .Case("sifive,bullet0", "sifive-u74")
+      .Case("spacemit,x60", "spacemit-x60")
+      .Case("spacemit,x100", "spacemit-x100")
+      .Case("spacemit,a100", "spacemit-a100")
       .Default("");
 }
 



More information about the llvm-commits mailing list