[llvm] d5c9d40 - [AMDGPU] Fix warnings about unused variables [NFC]

Mikael Holmen via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 00:37:26 PST 2024


Author: Mikael Holmen
Date: 2024-01-25T09:35:10+01:00
New Revision: d5c9d402f07e7448cd46870a59d981f582682548

URL: https://github.com/llvm/llvm-project/commit/d5c9d402f07e7448cd46870a59d981f582682548
DIFF: https://github.com/llvm/llvm-project/commit/d5c9d402f07e7448cd46870a59d981f582682548.diff

LOG: [AMDGPU] Fix warnings about unused variables [NFC]

Without this gcc warned like
 ../lib/Target/AMDGPU/GCNDPPCombine.cpp:371: warning: unused variable 'OpSelOpr' [-Wunused-variable]
   371 |       if (auto *OpSelOpr =
       |
 ../lib/Target/AMDGPU/GCNDPPCombine.cpp:388: warning: unused variable 'OpSelHiOpr' [-Wunused-variable]
   388 |       if (auto *OpSelHiOpr =
       |

Remove the unused variables.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp b/llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp
index 94d28dc0a2c74a..5090b0a07da4b0 100644
--- a/llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp
@@ -368,8 +368,7 @@ MachineInstr *GCNDPPCombine::createDPPInst(MachineInstr &OrigMI,
       }
       // Validate OP_SEL has to be set to all 0 and OP_SEL_HI has to be set to
       // all 1.
-      if (auto *OpSelOpr =
-              TII->getNamedOperand(OrigMI, AMDGPU::OpName::op_sel)) {
+      if (TII->getNamedOperand(OrigMI, AMDGPU::OpName::op_sel)) {
         int64_t OpSel = 0;
         OpSel |= (Mod0 ? (!!(Mod0->getImm() & SISrcMods::OP_SEL_0) << 0) : 0);
         OpSel |= (Mod1 ? (!!(Mod1->getImm() & SISrcMods::OP_SEL_0) << 1) : 0);
@@ -385,8 +384,7 @@ MachineInstr *GCNDPPCombine::createDPPInst(MachineInstr &OrigMI,
         if (AMDGPU::hasNamedOperand(DPPOp, AMDGPU::OpName::op_sel))
           DPPInst.addImm(OpSel);
       }
-      if (auto *OpSelHiOpr =
-              TII->getNamedOperand(OrigMI, AMDGPU::OpName::op_sel_hi)) {
+      if (TII->getNamedOperand(OrigMI, AMDGPU::OpName::op_sel_hi)) {
         int64_t OpSelHi = 0;
         OpSelHi |= (Mod0 ? (!!(Mod0->getImm() & SISrcMods::OP_SEL_1) << 0) : 0);
         OpSelHi |= (Mod1 ? (!!(Mod1->getImm() & SISrcMods::OP_SEL_1) << 1) : 0);


        


More information about the llvm-commits mailing list