[llvm] r364003 - [MIPS GlobalISel] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D63541

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 20 18:51:50 PDT 2019


Author: maskray
Date: Thu Jun 20 18:51:50 2019
New Revision: 364003

URL: http://llvm.org/viewvc/llvm-project?rev=364003&view=rev
Log:
[MIPS GlobalISel] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D63541

Modified:
    llvm/trunk/lib/Target/Mips/MipsInstructionSelector.cpp
    llvm/trunk/lib/Target/Mips/MipsRegisterBankInfo.cpp

Modified: llvm/trunk/lib/Target/Mips/MipsInstructionSelector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstructionSelector.cpp?rev=364003&r1=364002&r2=364003&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsInstructionSelector.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsInstructionSelector.cpp Thu Jun 20 18:51:50 2019
@@ -370,6 +370,7 @@ bool MipsInstructionSelector::select(Mac
   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");

Modified: llvm/trunk/lib/Target/Mips/MipsRegisterBankInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterBankInfo.cpp?rev=364003&r1=364002&r2=364003&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsRegisterBankInfo.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsRegisterBankInfo.cpp Thu Jun 20 18:51:50 2019
@@ -171,9 +171,9 @@ MipsRegisterBankInfo::getInstrMapping(co
                                           &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(co
   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 =




More information about the llvm-commits mailing list