From: Krzysztof Parzyszek Date: Fri, 31 Mar 2017 21:03:59 +0000 (+0000) Subject: [Hexagon] Remove unused variables X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a9ab69f8503764ed73e2f99701f2ca63029f1cc;p=llvm [Hexagon] Remove unused variables Found by PVS-Studio. Fixes llvm.org/PR31676. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299262 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Hexagon/HexagonAsmPrinter.cpp b/lib/Target/Hexagon/HexagonAsmPrinter.cpp index 01ba1ccd37f..891382b0678 100644 --- a/lib/Target/Hexagon/HexagonAsmPrinter.cpp +++ b/lib/Target/Hexagon/HexagonAsmPrinter.cpp @@ -611,13 +611,9 @@ void HexagonAsmPrinter::EmitInstruction(const MachineInstr *MI) { if (MI->isBundle()) { const MachineBasicBlock* MBB = MI->getParent(); MachineBasicBlock::const_instr_iterator MII = MI->getIterator(); - unsigned IgnoreCount = 0; for (++MII; MII != MBB->instr_end() && MII->isInsideBundle(); ++MII) - if (MII->getOpcode() == TargetOpcode::DBG_VALUE || - MII->getOpcode() == TargetOpcode::IMPLICIT_DEF) - ++IgnoreCount; - else + if (!MII->isDebugValue() && !MII->isImplicitDef()) HexagonLowerToMC(MCII, &*MII, MCB, *this); } else diff --git a/lib/Target/Hexagon/HexagonSplitDouble.cpp b/lib/Target/Hexagon/HexagonSplitDouble.cpp index 176d3f75e11..471e32221b2 100644 --- a/lib/Target/Hexagon/HexagonSplitDouble.cpp +++ b/lib/Target/Hexagon/HexagonSplitDouble.cpp @@ -393,7 +393,7 @@ int32_t HexagonSplitDoubleRegs::profit(const MachineInstr *MI) const { bool HexagonSplitDoubleRegs::isProfitable(const USet &Part, LoopRegMap &IRM) const { - unsigned FixedNum = 0, SplitNum = 0, LoopPhiNum = 0; + unsigned FixedNum = 0, LoopPhiNum = 0; int32_t TotalP = 0; for (unsigned DR : Part) { @@ -430,7 +430,6 @@ bool HexagonSplitDoubleRegs::isProfitable(const USet &Part, LoopRegMap &IRM) LoopPhiNum++; } // Splittable instruction. - SplitNum++; int32_t P = profit(UseI); if (P == std::numeric_limits::min()) return false; diff --git a/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp b/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp index 51aba946183..62b21c419f3 100644 --- a/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp +++ b/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp @@ -287,8 +287,8 @@ bool HexagonMCChecker::checkBranches() { HexagonMCErrInfo errInfo; if (HexagonMCInstrInfo::isBundle(MCB)) { bool hasConditional = false; - unsigned Branches = 0, Returns = 0, NewIndirectBranches = 0, - NewValueBranches = 0, Conditional = HEXAGON_PRESHUFFLE_PACKET_SIZE, + unsigned Branches = 0, + Conditional = HEXAGON_PRESHUFFLE_PACKET_SIZE, Unconditional = HEXAGON_PRESHUFFLE_PACKET_SIZE; for (unsigned i = HexagonMCInstrInfo::bundleInstructionsOffset; @@ -300,12 +300,6 @@ bool HexagonMCChecker::checkBranches() { if (HexagonMCInstrInfo::getDesc(MCII, MCI).isBranch() || HexagonMCInstrInfo::getDesc(MCII, MCI).isCall()) { ++Branches; - if (HexagonMCInstrInfo::getDesc(MCII, MCI).isIndirectBranch() && - HexagonMCInstrInfo::isPredicatedNew(MCII, MCI)) - ++NewIndirectBranches; - if (HexagonMCInstrInfo::isNewValue(MCII, MCI)) - ++NewValueBranches; - if (HexagonMCInstrInfo::isPredicated(MCII, MCI) || HexagonMCInstrInfo::isPredicatedNew(MCII, MCI)) { hasConditional = true; @@ -314,9 +308,6 @@ bool HexagonMCChecker::checkBranches() { Unconditional = i; // Record the position of the unconditional branch. } } - if (HexagonMCInstrInfo::getDesc(MCII, MCI).isReturn() && - HexagonMCInstrInfo::getDesc(MCII, MCI).mayLoad()) - ++Returns; } if (Branches) // FIXME: should "Defs.count(Hexagon::PC)" be here too?