[llvm] AMDGPU: Stop copying triple into AMDGPUSubtarget (PR #184147)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 06:57:18 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Matt Arsenault (arsenm)

<details>
<summary>Changes</summary>

Really the triple doesn't belong here at all.

---
Full diff: https://github.com/llvm/llvm-project/pull/184147.diff


1 Files Affected:

- (modified) llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h (+2-2) 


``````````diff
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
index 302fe7c850b75..4e1e54da5f4a9 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
@@ -46,7 +46,7 @@ class AMDGPUSubtarget {
   };
 
 private:
-  Triple TargetTriple;
+  const Triple &TargetTriple;
 
 protected:
   bool HasMulI24 = true;
@@ -61,7 +61,7 @@ class AMDGPUSubtarget {
   char WavefrontSizeLog2 = 0;
 
 public:
-  AMDGPUSubtarget(Triple TT) : TargetTriple(std::move(TT)) {}
+  AMDGPUSubtarget(const Triple &TT) : TargetTriple(TT) {}
 
   static const AMDGPUSubtarget &get(const MachineFunction &MF);
   static const AMDGPUSubtarget &get(const TargetMachine &TM,

``````````

</details>


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


More information about the llvm-commits mailing list