[PATCH] D151730: [RISCV] Support target attribute for function

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 27 16:58:53 PDT 2023


craig.topper added inline comments.


================
Comment at: clang/lib/Basic/Targets/RISCV.cpp:385
+          StringRef ExtName = Ext.substr(1);
+          if (llvm::RISCVISAInfo::isSupportedExtensionWithVersion(ExtName) ||
+              llvm::RISCVISAInfo::isSupportedExtension(ExtName))
----------------
I wonder if we could encapsulate this `if` and the 3 calls into RISCVISAInfo into a single function in RISCVISAInfo?

Basically we want to know if an extension that may or may not have a version, is a valid extension and if so what is the target feature name for it. We could have one function that does all that and returns the target feature name or an empty string.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151730



More information about the cfe-commits mailing list