[PATCH] D123978: [RISCV] Support getHostCpuName for sifive-u74

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 14:32:58 PDT 2022


luismarques added a comment.

This seems in line with what's done for the other archs, so overall seems fine.



================
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;
----------------
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?


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