================
@@ -428,13 +428,22 @@ std::string getPGOFuncNameVarName(StringRef FuncName,
   return VarName;
 }
 
+bool isGPUProfTarget(const Module &M) {
+  const auto &triple = M.getTargetTriple();
+  return triple.rfind("nvptx", 0) == 0 || triple.rfind("amdgcn", 0) == 0 ||
+         triple.rfind("r600", 0) == 0;
+}
+
----------------
EthanLuisMcDonough wrote:

I did briefly consider turning the `isGPUProfTarget` function into a method of 
either the Module or Triple class, but I was worried that would be out of the 
scope of this PR. Do you think adding an `isGPU` method to the Triple class 
would make things cleaner?

https://github.com/llvm/llvm-project/pull/76587
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to