[clang] [llvm] [LoongArch] add la v1.1 features for sys::getHostCPUFeatures (PR #115832)

Lu Weining via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 18:50:42 PST 2024


================
@@ -135,8 +135,13 @@ void loongarch::getLoongArchTargetFeatures(const Driver &D,
     Features.push_back("+lsx");
 
   std::string ArchName;
-  if (const Arg *A = Args.getLastArg(options::OPT_march_EQ))
+  if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) {
     ArchName = A->getValue();
+    if (ArchName == "native")
+      for (auto &F : llvm::sys::getHostCPUFeatures())
+        Features.push_back(
----------------
SixWeining wrote:

It's better to push these features after `llvm::LoongArch::getArchFeatures(ArchName, Feature)` is called. Because `getHostCPUFeatures()` is more exact than the latter.

https://github.com/llvm/llvm-project/pull/115832


More information about the cfe-commits mailing list