[flang-commits] [clang] [flang] [flang] Emit target features for PPC (PR #169860)

Kelvin Li via flang-commits flang-commits at lists.llvm.org
Fri Nov 28 09:47:11 PST 2025


================
@@ -318,8 +319,67 @@ getExplicitAndImplicitNVPTXTargetFeatures(clang::DiagnosticsEngine &diags,
   return llvm::join(featuresVec, ",");
 }
 
+enum ppcCPU { prePwr8, prePwr10 };
+static std::optional<ppcCPU> ppcType(std::string &cpu) {
+  return llvm::StringSwitch<std::optional<ppcCPU>>(cpu)
+      .Case("future", std::nullopt)
+      .Case("pwr11", std::nullopt)
+      .Case("pwr10", std::nullopt)
+      .Case("pwr9", prePwr10)
+      .Case("pwr8", prePwr10)
+      .Default(prePwr8);
+}
+
+static std::string
+getExplicitAndImplicitPPCTargetFeatures(clang::DiagnosticsEngine &diags,
+                                        TargetOptions &targetOpts,
----------------
kkwli wrote:

We want to get the list from `llvm::PPC::getPPCDefaultTargetFeatures` for PPC. On other platforms, it relies on the list obtained from the `createTargetMachine` call.

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


More information about the flang-commits mailing list