Fix -Wunused-variable and -Wunused-but-set-variable in -DLLVM_ENABLE_ASSERTIONS=off...
authorFangrui Song <i@maskray.me>
Sun, 20 Jun 2021 18:09:07 +0000 (11:09 -0700)
committerFangrui Song <i@maskray.me>
Sun, 20 Jun 2021 18:09:07 +0000 (11:09 -0700)
llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp

index 7f05975..0fa599d 100644 (file)
@@ -2918,6 +2918,7 @@ static int getIntOperandFromRegisterString(StringRef RegString) {
 
   assert(AllIntFields &&
           "Unexpected non-integer value in special register string.");
+  (void)AllIntFields;
 
   // Need to combine the integer fields of the string into a single value
   // based on the bit encoding of MRS/MSR instruction.
index f288344..0404fef 100644 (file)
@@ -2082,9 +2082,7 @@ bool AMDGPULegalizerInfo::legalizeFPTOI(MachineInstr &MI,
   const LLT S32 = LLT::scalar(32);
 
   const LLT SrcLT = MRI.getType(Src);
-  const LLT DstLT = MRI.getType(Dst);
-
-  assert((SrcLT == S32 || SrcLT == S64) && DstLT == S64);
+  assert((SrcLT == S32 || SrcLT == S64) && MRI.getType(Dst) == S64);
 
   unsigned Flags = MI.getFlags();
 
index be9d383..4eee7a7 100644 (file)
@@ -5214,6 +5214,7 @@ static void getIntOperandsFromRegisterString(StringRef RegString,
 
     assert(AllIntFields &&
             "Unexpected non-integer value in special register string.");
+    (void)AllIntFields;
   }
 }