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

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 20:15:12 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:
> StephenFan wrote:
> > 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. 
> And those other boards can't be recognized from the uarch line?
I think they can. But I don't have those boards currently.


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