[PATCH] D105274: Define sys::getHostCPUName for RISC-V
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 1 09:48:24 PDT 2021
craig.topper added inline comments.
================
Comment at: llvm/lib/Support/Host.cpp:1325
+ return "generic-rv64";
+#else
+ return "generic-rv32";
----------------
Should we check __riscv_xlen == 32 here and leave some assert return "generic" if its not one of the 2 values. That would cover us better if __riscv_xlen isn't defined for some reason
================
Comment at: llvm/lib/Support/Host.cpp:1414
+#elif defined(__linux__) && (defined(__s390x__) || defined(__riscv))
int computeHostNumPhysicalCores() { return sysconf(_SC_NPROCESSORS_ONLN); }
#elif defined(__APPLE__) && defined(__x86_64__)
----------------
Just curious why other linux platforms like x86 and power pc have a different solution?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105274/new/
https://reviews.llvm.org/D105274
More information about the llvm-commits
mailing list