[llvm] a6f87ab - [Mips] Remove a trivial variable (NFC) (#105940)

via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 24 16:20:42 PDT 2024


Author: Kazu Hirata
Date: 2024-08-24T16:20:38-07:00
New Revision: a6f87abf73be02be0b7c50083b3d93ac81a80c29

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

LOG: [Mips] Remove a trivial variable (NFC) (#105940)

We assign I->getNumOperands() to J and immediately print that out as a
debug message.  We don't need to keep J across iterations.

Added: 
    

Modified: 
    llvm/lib/Target/Mips/MipsConstantIslandPass.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp b/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp
index 0341af0caac46e..60bb10369df4fa 100644
--- a/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp
+++ b/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp
@@ -1630,8 +1630,6 @@ MipsConstantIslands::fixupConditionalBr(ImmBranch &Br) {
 }
 
 void MipsConstantIslands::prescanForConstants() {
-  unsigned J = 0;
-  (void)J;
   for (MachineBasicBlock &B : *MF) {
     for (MachineBasicBlock::instr_iterator I = B.instr_begin(),
                                            EB = B.instr_end();
@@ -1640,8 +1638,7 @@ void MipsConstantIslands::prescanForConstants() {
         case Mips::LwConstant32: {
           PrescannedForConstants = true;
           LLVM_DEBUG(dbgs() << "constant island constant " << *I << "\n");
-          J = I->getNumOperands();
-          LLVM_DEBUG(dbgs() << "num operands " << J << "\n");
+          LLVM_DEBUG(dbgs() << "num operands " << I->getNumOperands() << "\n");
           MachineOperand& Literal = I->getOperand(1);
           if (Literal.isImm()) {
             int64_t V = Literal.getImm();


        


More information about the llvm-commits mailing list