================ @@ -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; +} + ---------------- jhuber6 wrote:
```suggestion bool isGPUProfTarget(const Module &M) { const llvm::Triple &Triple = M.getTargetTriple(); return Triple.isAMDGPU() || Triple.isNVPTX() } ``` Standard way looks like this. Side note, we really need a way to express this in a more re-usable way especially with SYCL looming. @arsenm should be make some common interface in `CodeGenModule` that just returns if we're currently targeting a "GPU like" device? 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