[PATCH] D141479: [RISCV] Generate march string from target features

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 02:50:11 PST 2023


fpetrogalli accepted this revision.
fpetrogalli added inline comments.


================
Comment at: llvm/utils/TableGen/RISCVTargetDefEmitter.cpp:33
+// We can generate march string from target features as what has been described
+// in RISCV ISA specification 'Chapter 27. ISA Extension Naming Conventions'.
+//
----------------
Nit: link to the specific version, or mention the version.


================
Comment at: llvm/utils/TableGen/RISCVTargetDefEmitter.cpp:39
+    if (llvm::RISCVISAInfo::isSupportedExtensionFeature(FeatureName))
+      FeatureVector.push_back((Twine("+") + FeatureName).str());
+  }
----------------
pcwang-thead wrote:
> fpetrogalli wrote:
> > Nit - maybe if you set `std::vector<StringRef> FeatureVector;` you can avoid the `.str()` in here?
> I'm afraid not, because we expect `std::vector<std::string>` in `llvm::RISCVISAInfo::parseFeatures`.
Oh - OK - thanks


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141479/new/

https://reviews.llvm.org/D141479



More information about the llvm-commits mailing list