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

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 24 07:33:37 PDT 2024


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/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.


>From 49554f648c0dbbb270a1b27d3ee69d356824b9a0 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sat, 24 Aug 2024 07:24:59 -0700
Subject: [PATCH] [Mips] Remove a trivial variable (NFC)

We assign I->getNumOperands() to J and immediately print that out as a
debug message.  We don't need to keep J across iterations.
---
 llvm/lib/Target/Mips/MipsConstantIslandPass.cpp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

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