Fix some -Wunused-but-set-variable in -DLLVM_ENABLE_ASSERTIONS=off build
authorFangrui Song <i@maskray.me>
Sat, 5 Jun 2021 06:34:43 +0000 (23:34 -0700)
committerFangrui Song <i@maskray.me>
Sat, 5 Jun 2021 06:34:43 +0000 (23:34 -0700)
llvm/lib/Analysis/BranchProbabilityInfo.cpp
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/Target/X86/X86FastISel.cpp
llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
llvm/utils/TableGen/X86DisassemblerTables.cpp

index 2bbf421..798d078 100644 (file)
@@ -1191,6 +1191,7 @@ void BranchProbabilityInfo::setEdgeProbability(
   // should be within Probs.size / BranchProbability::getDenominator.
   assert(TotalNumerator <= BranchProbability::getDenominator() + Probs.size());
   assert(TotalNumerator >= BranchProbability::getDenominator() - Probs.size());
+  (void)TotalNumerator;
 }
 
 void BranchProbabilityInfo::copyEdgeProbabilities(BasicBlock *Src,
index 91599e2..7a24994 100644 (file)
@@ -9177,6 +9177,7 @@ bool LLParser::parseOptionalParamAccesses(
       return true;
     CallsNum += ParamAccess.Calls.size();
     assert(VContexts.size() == CallsNum);
+    (void)CallsNum;
     Params.emplace_back(std::move(ParamAccess));
   } while (EatIfPresent(lltok::comma));
 
index 8a6b9e7..44670a9 100644 (file)
@@ -2577,6 +2577,7 @@ bool X86FastISel::TryEmitSmallMemcpy(X86AddressMode DestAM,
     bool RV = X86FastEmitLoad(VT, SrcAM, nullptr, Reg);
     RV &= X86FastEmitStore(VT, Reg, DestAM);
     assert(RV && "Failed to emit load or store??");
+    (void)RV;
 
     unsigned Size = VT.getSizeInBits()/8;
     Len -= Size;
index b630cb4..9a3afa9 100644 (file)
@@ -234,6 +234,7 @@ ICallPromotionFunc::getPromotionCandidatesForCallSite(
   for (uint32_t I = 0; I < NumCandidates; I++) {
     uint64_t Count = ValueDataRef[I].Count;
     assert(Count <= TotalCount);
+    (void)TotalCount;
     uint64_t Target = ValueDataRef[I].Value;
     LLVM_DEBUG(dbgs() << " Candidate " << I << " Count=" << Count
                       << "  Target_func: " << Target << "\n");
index 651aaa3..ff7905b 100644 (file)
@@ -637,6 +637,7 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
       }
       assert(SplitLatchEdge &&
              "Despite splitting all preds, failed to split latch exit?");
+      (void)SplitLatchEdge;
     } else {
       // We can fold the conditional branch in the preheader, this makes things
       // simpler. The first step is to remove the extra edge to the Exit block.
index 0505c08..2d25289 100644 (file)
@@ -742,6 +742,7 @@ void DisassemblerTables::emitModRMDecision(raw_ostream &o1, raw_ostream &o2,
   // We assume that the index can fit into uint16_t.
   assert(sEntryNumber < 65536U &&
          "Index into ModRMDecision is too large for uint16_t!");
+  (void)sEntryNumber;
 
   ++sTableNumber;
 }