llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: Matt Arsenault (arsenm) <details> <summary>Changes</summary> This function made no sense at all. It was scanning through the feature map looking for something that parsed as an OffloadArch. Directly compute the arch from the target device. I don't know why there isn't just an OffloadArch in TargetOpts, this shouldn't really require parsing. --- Full diff: https://github.com/llvm/llvm-project/pull/189561.diff 1 Files Affected: - (modified) clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp (+3-12) ``````````diff diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp index 4fc10e4165465..1ca04e18adcb0 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp @@ -2261,18 +2261,9 @@ bool CGOpenMPRuntimeGPU::hasAllocateAttributeForGlobalVar(const VarDecl *VD, return false; } -// Get current OffloadArch and ignore any unknown values -static OffloadArch getOffloadArch(CodeGenModule &CGM) { - if (!CGM.getTarget().hasFeature("ptx")) - return OffloadArch::Unknown; - for (const auto &Feature : CGM.getTarget().getTargetOpts().FeatureMap) { - if (Feature.getValue()) { - OffloadArch Arch = StringToOffloadArch(Feature.getKey()); - if (Arch != OffloadArch::Unknown) - return Arch; - } - } - return OffloadArch::Unknown; +static OffloadArch getOffloadArch(const CodeGenModule &CGM) { + // FIXME: This should not require parsing + return StringToOffloadArch(CGM.getTarget().getTargetOpts().CPU); } /// Check to see if target architecture supports unified addressing which is `````````` </details> https://github.com/llvm/llvm-project/pull/189561 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
