This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Support getHostCpuName for sifive-u74
ClosedPublic

Authored by StephenFan on Apr 18 2022, 8:46 PM.

Diff Detail

Event Timeline

StephenFan created this revision.Apr 18 2022, 8:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2022, 8:46 PM
StephenFan requested review of this revision.Apr 18 2022, 8:46 PM

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

llvm/lib/Support/Host.cpp
383–401

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?

StephenFan added inline comments.Apr 19 2022, 8:47 PM
llvm/lib/Support/Host.cpp
383–401

Yes, I think we will have more and more RISC-V development boards in the future.

luismarques added inline comments.Apr 20 2022, 3:10 AM
llvm/lib/Support/Host.cpp
383–401

And those other boards can't be recognized from the uarch line?

StephenFan added inline comments.Apr 20 2022, 8:15 PM
llvm/lib/Support/Host.cpp
383–401

I think they can. But I don't have those boards currently.

kito-cheng added inline comments.Apr 23 2022, 6:37 PM
llvm/lib/Support/Host.cpp
383–401

I've confirmed with my colleague, sifive,u74-mc is right, and he suggest we should recognize sifive,bullet0[1] too, because that what upstream linux use, and sifive,u74-mc are used in SiFive's OpenEmbedded release[2].

[1] https://github.com/torvalds/linux/blob/master/arch/riscv/boot/dts/sifive/fu740-c000.dtsi#L42
[2] https://github.com/sifive/meta-sifive/blob/2022.03/recipes-kernel/linux/files/0001-riscv-sifive-fu740-cpu-1-2-3-4-set-compatible-to-sif.patch

Thanks for confirming it! @kito-cheng

ChangeLog:

Add "sifive,bullet0"

This revision is now accepted and ready to land.Apr 24 2022, 8:15 PM
MaskRay added inline comments.Apr 25 2022, 12:14 AM
llvm/lib/Support/Host.cpp
385

It's unnecessary to optimize for avoiding the memory allocation.

MaskRay added inline comments.Apr 25 2022, 12:15 AM
llvm/unittests/Support/Host.cpp
378

StringLiteral

  1. Replace std::string to StringRef
  2. Remove size value for SmallVector
StephenFan marked 2 inline comments as done.Apr 28 2022, 7:41 PM
This revision was landed with ongoing or failed builds.May 16 2022, 11:37 PM
This revision was automatically updated to reflect the committed changes.