From 8ef67fd113e0b02ba59dbfa8b24a2bec22475c3a Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Fri, 11 Oct 2019 21:51:39 +0000 Subject: [PATCH] [mips] Remove unused local variables. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374599 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 30 ++++++++------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 24da28c89f3..86f50185c2d 100644 --- a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -3322,9 +3322,7 @@ bool MipsAsmParser::expandLoadSingleImmToGPR(MCInst &Inst, SMLoc IDLoc, unsigned FirstReg = Inst.getOperand(0).getReg(); uint64_t ImmOp64 = Inst.getOperand(1).getImm(); - ImmOp64 = convertIntToDoubleImm(ImmOp64); - - uint32_t ImmOp32 = covertDoubleImmToSingleImm(ImmOp64); + uint32_t ImmOp32 = covertDoubleImmToSingleImm(convertIntToDoubleImm(ImmOp64)); return loadImmediate(ImmOp32, FirstReg, Mips::NoRegister, true, true, IDLoc, Out, STI); @@ -3397,20 +3395,13 @@ bool MipsAsmParser::expandLoadDoubleImmToGPR(MCInst &Inst, SMLoc IDLoc, ImmOp64 = convertIntToDoubleImm(ImmOp64); - uint32_t LoImmOp64 = Lo_32(ImmOp64); - uint32_t HiImmOp64 = Hi_32(ImmOp64); - - unsigned TmpReg = getATReg(IDLoc); - if (!TmpReg) - return true; - - if (LoImmOp64 == 0) { + if (Lo_32(ImmOp64) == 0) { if (isABI_N32() || isABI_N64()) { if (loadImmediate(ImmOp64, FirstReg, Mips::NoRegister, false, true, IDLoc, Out, STI)) return true; } else { - if (loadImmediate(HiImmOp64, FirstReg, Mips::NoRegister, true, true, + if (loadImmediate(Hi_32(ImmOp64), FirstReg, Mips::NoRegister, true, true, IDLoc, Out, STI)) return true; @@ -3437,6 +3428,10 @@ bool MipsAsmParser::expandLoadDoubleImmToGPR(MCInst &Inst, SMLoc IDLoc, getStreamer().EmitIntValue(ImmOp64, 8); getStreamer().SwitchSection(CS); + unsigned TmpReg = getATReg(IDLoc); + if (!TmpReg) + return true; + if (emitPartialAddress(TOut, IDLoc, Sym)) return true; @@ -3469,9 +3464,6 @@ bool MipsAsmParser::expandLoadDoubleImmToFPR(MCInst &Inst, bool Is64FPU, ImmOp64 = convertIntToDoubleImm(ImmOp64); - uint32_t LoImmOp64 = Lo_32(ImmOp64); - uint32_t HiImmOp64 = Hi_32(ImmOp64); - unsigned TmpReg = Mips::ZERO; if (ImmOp64 != 0) { TmpReg = getATReg(IDLoc); @@ -3479,8 +3471,8 @@ bool MipsAsmParser::expandLoadDoubleImmToFPR(MCInst &Inst, bool Is64FPU, return true; } - if ((LoImmOp64 == 0) && - !((HiImmOp64 & 0xffff0000) && (HiImmOp64 & 0x0000ffff))) { + if ((Lo_32(ImmOp64) == 0) && + !((Hi_32(ImmOp64) & 0xffff0000) && (Hi_32(ImmOp64) & 0x0000ffff))) { if (isABI_N32() || isABI_N64()) { if (TmpReg != Mips::ZERO && loadImmediate(ImmOp64, TmpReg, Mips::NoRegister, false, false, IDLoc, @@ -3491,8 +3483,8 @@ bool MipsAsmParser::expandLoadDoubleImmToFPR(MCInst &Inst, bool Is64FPU, } if (TmpReg != Mips::ZERO && - loadImmediate(HiImmOp64, TmpReg, Mips::NoRegister, true, false, IDLoc, - Out, STI)) + loadImmediate(Hi_32(ImmOp64), TmpReg, Mips::NoRegister, true, false, + IDLoc, Out, STI)) return true; if (hasMips32r2()) { -- 2.40.0