[llvm] AMDGPU: Fix copy of Triple (PR #184594)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 04:09:41 PST 2026


https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/184594

>From 8260200c60ab980cb5977a156db2481b51f595dc Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Wed, 4 Mar 2026 12:15:02 +0100
Subject: [PATCH 1/2] AMDGPU: Fix copy of Triple

---
 llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
index 865770031bb06..428e4cfdd9a25 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
@@ -1135,7 +1135,7 @@ std::string AMDGPUTargetID::toString() const {
   std::string StringRep;
   raw_string_ostream StreamRep(StringRep);
 
-  auto TargetTriple = STI.getTargetTriple();
+  const Triple &TargetTriple = STI.getTargetTriple();
   auto Version = getIsaVersion(STI.getCPU());
 
   StreamRep << TargetTriple.getArchName() << '-' << TargetTriple.getVendorName()

>From 4a46bdbeed663162f2bdac992c6392582bd8d01f Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Wed, 4 Mar 2026 13:09:31 +0100
Subject: [PATCH 2/2] Update llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Co-authored-by: Juan Manuel Martinez CaamaƱo <jmartinezcaamao at gmail.com>
---
 llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
index 428e4cfdd9a25..d862805a60027 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
@@ -1154,7 +1154,7 @@ std::string AMDGPUTargetID::toString() const {
                     .str();
 
   std::string Features;
-  if (STI.getTargetTriple().getOS() == Triple::AMDHSA) {
+  if (TargetTriple.getOS() == Triple::AMDHSA) {
     // sramecc.
     if (getSramEccSetting() == TargetIDSetting::Off)
       Features += ":sramecc-";



More information about the llvm-commits mailing list