[PATCH] D123978: [RISCV] Support getHostCpuName for sifive-u74
luxufan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 19 20:47:36 PDT 2022
StephenFan added inline comments.
================
Comment at: llvm/lib/Support/Host.cpp:383-401
+StringRef sys::detail::getHostCPUNameForRISCV(StringRef ProcCpuinfoContent) {
+ // There are 24 lines in /proc/cpuinfo
+ SmallVector<StringRef, 24> Lines;
+ ProcCpuinfoContent.split(Lines, "\n");
+
+ // Look for uarch line to determine cpu name
+ StringRef UArch;
----------------
luismarques wrote:
> It seems a bit silly to allocate memory for all the line references if we are only going to care about one of them. Do you expect we'll need some of the other lines as well in the future?
Yes, I think we will have more and more RISC-V development boards in the future.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123978/new/
https://reviews.llvm.org/D123978
More information about the llvm-commits
mailing list