[llvm] [Offload][AMDGPU] accept generic target (PR #118919)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 10:08:26 PST 2024


================
@@ -205,13 +205,13 @@ Expected<std::string> getTargetTripleAndFeatures(hsa_agent_t Agent) {
       return Status;
 
     llvm::StringRef TripleTarget(ISAName.begin(), Length);
-    if (TripleTarget.consume_front("amdgcn-amd-amdhsa"))
-      Target = TripleTarget.ltrim('-').rtrim('\0').str();
-    return HSA_STATUS_INFO_BREAK;
+    if (TripleTarget.consume_front("amdgcn-amd-amdhsa")) {
+      auto Target = TripleTarget.ltrim('-').rtrim('\0');
+      Targets.push_back(Target);
----------------
jhuber6 wrote:

`StringRef` here is a reference to the stack var `ISAName`, you are pushing back a reference to a local.

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


More information about the llvm-commits mailing list