[PATCH] D105274: Define sys::getHostCPUName for RISC-V

Andreas Schwab via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 11 11:07:29 PDT 2021


schwab updated this revision to Diff 357812.
schwab added a comment.

Drop computeHostNumPhysicalCores change for now.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105274/new/

https://reviews.llvm.org/D105274

Files:
  llvm/lib/Support/Host.cpp


Index: llvm/lib/Support/Host.cpp
===================================================================
--- llvm/lib/Support/Host.cpp
+++ llvm/lib/Support/Host.cpp
@@ -1318,6 +1318,17 @@
     return "generic";
   }
 }
+#elif defined(__riscv)
+StringRef sys::getHostCPUName() {
+#if __riscv_xlen == 64
+  return "generic-rv64";
+#elif __riscv_xlen == 32
+  return "generic-rv32";
+#else
+  assert(false && "Unhandled value of __riscv_xlen");
+  return "generic";
+#endif
+}
 #else
 StringRef sys::getHostCPUName() { return "generic"; }
 namespace llvm {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105274.357812.patch
Type: text/x-patch
Size: 550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210711/a66fa3eb/attachment.bin>


More information about the llvm-commits mailing list