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

via flang-commits flang-commits at lists.llvm.org
Fri Nov 28 08:16:50 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,
----------------
jeanPerier wrote:

I find it really tricky that this version is modifying the targetOpts while the other similar versions for AMD and NVPTX are not.

Why is this required for PPC and not the other platform with implicit target features?

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


More information about the flang-commits mailing list