From ddd056c9847793d1b56c0cbe8fce1264a012a7e2 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 21 Jun 2019 01:51:50 +0000 Subject: [PATCH] [MIPS GlobalISel] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D63541 llvm-svn: 364003 --- llvm/lib/Target/Mips/MipsInstructionSelector.cpp | 1 + llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/Mips/MipsInstructionSelector.cpp b/llvm/lib/Target/Mips/MipsInstructionSelector.cpp index f058ebb26452..fe01b15eab3e 100644 --- a/llvm/lib/Target/Mips/MipsInstructionSelector.cpp +++ b/llvm/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/llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp b/llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp index b9d7f0468faf..8c2dc90811b9 100644 --- a/llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp +++ b/llvm/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 =