From: Fangrui Song Date: Fri, 21 Jun 2019 01:51:50 +0000 (+0000) Subject: [MIPS GlobalISel] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4ff6a2c5e7cdf6e208c9cf01bc49e1fcfc2b5a5;p=llvm [MIPS GlobalISel] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D63541 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364003 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Mips/MipsInstructionSelector.cpp b/lib/Target/Mips/MipsInstructionSelector.cpp index f058ebb2645..fe01b15eab3 100644 --- a/lib/Target/Mips/MipsInstructionSelector.cpp +++ b/lib/Target/Mips/MipsInstructionSelector.cpp @@ -370,6 +370,7 @@ bool MipsInstructionSelector::select(MachineInstr &I, case G_FPTOSI: { unsigned FromSize = MRI.getType(I.getOperand(1).getReg()).getSizeInBits(); unsigned ToSize = MRI.getType(I.getOperand(0).getReg()).getSizeInBits(); + (void)ToSize; assert((ToSize == 32) && "Unsupported integer size for G_FPTOSI"); assert((FromSize == 32 || FromSize == 64) && "Unsupported floating point size for G_FPTOSI"); diff --git a/lib/Target/Mips/MipsRegisterBankInfo.cpp b/lib/Target/Mips/MipsRegisterBankInfo.cpp index b9d7f0468fa..8c2dc90811b 100644 --- a/lib/Target/Mips/MipsRegisterBankInfo.cpp +++ b/lib/Target/Mips/MipsRegisterBankInfo.cpp @@ -171,9 +171,9 @@ MipsRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const { &Mips::ValueMappings[Mips::DPRIdx]}); break; case G_FPTOSI: { - unsigned SizeInt = MRI.getType(MI.getOperand(0).getReg()).getSizeInBits(); unsigned SizeFP = MRI.getType(MI.getOperand(1).getReg()).getSizeInBits(); - assert((SizeInt == 32) && "Unsupported integer size"); + assert((MRI.getType(MI.getOperand(0).getReg()).getSizeInBits() == 32) && + "Unsupported integer size"); assert((SizeFP == 32 || SizeFP == 64) && "Unsupported floating point size"); OperandsMapping = getOperandsMapping({ &Mips::ValueMappings[Mips::GPRIdx], @@ -185,6 +185,7 @@ MipsRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const { case G_SITOFP: { unsigned SizeInt = MRI.getType(MI.getOperand(1).getReg()).getSizeInBits(); unsigned SizeFP = MRI.getType(MI.getOperand(0).getReg()).getSizeInBits(); + (void)SizeInt; assert((SizeInt == 32) && "Unsupported integer size"); assert((SizeFP == 32 || SizeFP == 64) && "Unsupported floating point size"); OperandsMapping =