[llvm] [AMDGPU][MC] fix unused template warning during build (PR #116313)

via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 22:28:16 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Brox Chen (broxigarchen)

<details>
<summary>Changes</summary>

This is a non-functional change. Passing the opName to VINTERP_Real_gfx11_gfx12 pseduo to suppress the warning during build

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


1 Files Affected:

- (modified) llvm/lib/Target/AMDGPU/VINTERPInstructions.td (+10-9) 


``````````diff
diff --git a/llvm/lib/Target/AMDGPU/VINTERPInstructions.td b/llvm/lib/Target/AMDGPU/VINTERPInstructions.td
index fa06d96085820e..742f9bc7c504b1 100644
--- a/llvm/lib/Target/AMDGPU/VINTERPInstructions.td
+++ b/llvm/lib/Target/AMDGPU/VINTERPInstructions.td
@@ -203,8 +203,8 @@ defm : VInterpF16Pat<int_amdgcn_interp_p2_rtz_f16,
 // VINTERP Real Instructions
 //===----------------------------------------------------------------------===//
 
-multiclass VINTERP_Real_gfx11 <bits<7> op, string asmName> {
-  defvar ps = !cast<VOP3_Pseudo>(NAME);
+multiclass VINTERP_Real_gfx11 <bits<7> op, string asmName, string opName = NAME> {
+  defvar ps = !cast<VOP3_Pseudo>(opName);
   let AssemblerPredicate = isGFX11Only, DecoderNamespace = "GFX11" #
                            !if(ps.Pfl.IsRealTrue16, "", "_FAKE16") in {
     def _gfx11 :
@@ -213,8 +213,8 @@ multiclass VINTERP_Real_gfx11 <bits<7> op, string asmName> {
   }
 }
 
-multiclass VINTERP_Real_gfx12 <bits<7> op, string asmName> {
-  defvar ps = !cast<VOP3_Pseudo>(NAME);
+multiclass VINTERP_Real_gfx12 <bits<7> op, string asmName, string opName = NAME> {
+  defvar ps = !cast<VOP3_Pseudo>(opName);
   let AssemblerPredicate = isGFX12Only, DecoderNamespace = "GFX12" #
                            !if(ps.Pfl.IsRealTrue16, "", "_FAKE16") in {
     def _gfx12 :
@@ -223,12 +223,13 @@ multiclass VINTERP_Real_gfx12 <bits<7> op, string asmName> {
   }
 }
 
-multiclass VINTERP_Real_gfx11_gfx12 <bits<7> op, string asmName = !cast<VOP3_Pseudo>(NAME).Mnemonic> :
-  VINTERP_Real_gfx11<op, asmName>, VINTERP_Real_gfx12<op, asmName>;
 
-multiclass VINTERP_Real_t16_and_fake16_gfx11_gfx12 <bits<7> op, string asmName = !cast<VOP3_Pseudo>(NAME).Mnemonic> {
-  defm _t16:    VINTERP_Real_gfx11_gfx12<op, asmName>;
-  defm _fake16: VINTERP_Real_gfx11_gfx12<op, asmName>;
+multiclass VINTERP_Real_gfx11_gfx12 <bits<7> op, string asmName = !cast<VOP3_Pseudo>(NAME).Mnemonic, string opName = NAME> :
+  VINTERP_Real_gfx11<op, asmName, opName>, VINTERP_Real_gfx12<op, asmName, opName>;
+
+multiclass VINTERP_Real_t16_and_fake16_gfx11_gfx12 <bits<7> op, string asmName = !cast<VOP3_Pseudo>(NAME).Mnemonic, string opName = NAME> {
+  defm _t16:    VINTERP_Real_gfx11_gfx12<op, asmName, opName#"_t16">;
+  defm _fake16: VINTERP_Real_gfx11_gfx12<op, asmName, opName#"_fake16">;
 }
 
 

``````````

</details>


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


More information about the llvm-commits mailing list