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

Brox Chen via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 17:45:54 PST 2024


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

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

>From 609b06b701be125003eb98a4a8c8853835db293a Mon Sep 17 00:00:00 2001
From: guochen2 <guochen2 at amd.com>
Date: Thu, 14 Nov 2024 20:43:08 -0500
Subject: [PATCH] passing opName to suppress warning

---
 llvm/lib/Target/AMDGPU/VINTERPInstructions.td | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/llvm/lib/Target/AMDGPU/VINTERPInstructions.td b/llvm/lib/Target/AMDGPU/VINTERPInstructions.td
index 860a3d775d600d..c87b72e5701d1f 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 :
@@ -224,7 +224,7 @@ multiclass VINTERP_Real_gfx12 <bits<7> op, string asmName> {
 }
 
 multiclass VINTERP_Real_gfx11_gfx12 <bits<7> op, string asmName = !cast<VOP3_Pseudo>(NAME).Mnemonic, string opName = NAME> :
-  VINTERP_Real_gfx11<op, asmName>, VINTERP_Real_gfx12<op, asmName>;
+  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">;



More information about the llvm-commits mailing list