[llvm-branch-commits] [clang] [llvm] [RISCV] Support __builtin_cpu_is (PR #116231)

Sam Elliott via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Nov 19 01:46:58 PST 2024


================
@@ -58,6 +58,19 @@ bool hasFastVectorUnalignedAccess(StringRef CPU) {
   return Info && Info->FastVectorUnalignedAccess;
 }
 
+bool hasValidCPUModel(StringRef CPU) {
+  const CPUModel CPUModel = getCPUModel(CPU);
+  return CPUModel.MVendorID != 0 && CPUModel.MArchID != 0 &&
----------------
lenary wrote:

Can you add a test for this error maybe? I think maybe the generic cpus will never have IDs so should be fine for tests.

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


More information about the llvm-branch-commits mailing list