================
@@ -97,6 +98,47 @@ std::string aarch64::getAArch64TargetCPU(const ArgList &Args,
return getAArch64TargetCPUByTriple(Triple);
}
+/// \return the target tune CPU LLVM name based on the target triple.
+static std::optional<std::string>
+getAArch64TargetTuneCPUByTriple(const llvm::Triple &Triple) {
+ // Apple Silicon macs default to the latest available target for tuning.
+ if (Triple.isTargetMachineMac() &&
+ Triple.getArch() == llvm::Triple::aarch64) {
+ return "apple-m5";
+ }
+ return std::nullopt;
+}
+
+/// \return the LLVM name of the AArch64 tune CPU we should target.
+/// Returns std::nullopt if no tune CPU should be specified.
+///
+/// Note: Unlike getAArch64TargetCPU, this function does not resolve
+/// CPU aliases, as it is currently not used for target architecture feature
----------------
rj-jesus wrote:
Maybe format this to 80 columns (by moving `CPU' to the line above)?
https://github.com/llvm/llvm-project/pull/179136
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits