diff --git a/llvm/lib/Transforms/IPO/PartialInlining.cpp b/llvm/lib/Transforms/IPO/PartialInlining.cpp index 7402e399a88a07..2d717475ce7f1d 100644 --- a/llvm/lib/Transforms/IPO/PartialInlining.cpp +++ b/llvm/lib/Transforms/IPO/PartialInlining.cpp @@ -641,8 +641,7 @@ PartialInlinerImpl::computeOutliningInfo(Function &F) const { if (!CandidateFound) return std::unique_ptr(); - // Do sanity check of the entries: threre should not - // be any successors (not in the entry set) other than + // There should not be any successors (not in the entry set) other than // {ReturnBlock, NonReturnBlock} assert(OutliningInfo->Entries[0] == &F.front() && "Function Entry must be the first in Entries vector"); diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index bfa7bfa2290ae4..7da2669e1d1358 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -2641,7 +2641,7 @@ Instruction *InstCombinerImpl::visitCallBase(CallBase &Call) { ArgNo++; } - assert(ArgNo == Call.arg_size() && "sanity check"); + assert(ArgNo == Call.arg_size() && "Call arguments not processed correctly."); if (!ArgNos.empty()) { AttributeList AS = Call.getAttributes(); diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 7a9e177f19dae1..f011692a500890 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -2803,7 +2803,8 @@ bool InstCombinerImpl::matchThreeWayIntCompare(SelectInst *SI, Value *&LHS, PredB, cast(RHS2)); if (!FlippedStrictness) return false; - assert(FlippedStrictness->first == ICmpInst::ICMP_SGE && "Sanity check"); + assert(FlippedStrictness->first == ICmpInst::ICMP_SGE && + "basic correctness failure"); RHS2 = FlippedStrictness->second; // And kind-of perform the result swap. std::swap(Less, Greater); diff --git a/llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp b/llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp index 7dc516c6fdc319..42ba4a34a5a9d2 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp @@ -403,7 +403,7 @@ LLVM_NODISCARD Value *Negator::visitImpl(Value *V, unsigned Depth) { NonNegatedOps.emplace_back(Op); // Just record which operand that was. } assert((NegatedOps.size() + NonNegatedOps.size()) == 2 && - "Internal consistency sanity check."); + "Internal consistency check failed."); // Did we manage to sink negation into both of the operands? if (NegatedOps.size() == 2) // Then we get to keep the `add`! return Builder.CreateAdd(NegatedOps[0], NegatedOps[1], diff --git a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index f98e39d751f4d6..180012198c42cf 100644 --- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -110,7 +110,7 @@ namespace { /// the module. struct ThreadSanitizer { ThreadSanitizer() { - // Sanity check options and warn user. + // Check options and warn user. if (ClInstrumentReadBeforeWrite && ClCompoundReadBeforeWrite) { errs() << "warning: Option -tsan-compound-read-before-write has no effect " diff --git a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp index ca9567dc7ac8ae..71509ebb6a2095 100644 --- a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp +++ b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp @@ -688,7 +688,7 @@ static bool processCallSite(CallBase &CB, LazyValueInfo *LVI) { ArgNo++; } - assert(ArgNo == CB.arg_size() && "sanity check"); + assert(ArgNo == CB.arg_size() && "Call arguments not processed correctly."); if (ArgNos.empty()) return Changed; diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index bf714d16767034..f5360a3d54b9b7 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -486,7 +486,7 @@ bool LoopInvariantCodeMotion::runOnLoop( // Check that neither this loop nor its parent have had LCSSA broken. LICM is // specifically moving instructions across the loop boundary and so it is - // especially in need of sanity checking here. + // especially in need of basic functional correctness checking here. assert(L->isLCSSAForm(*DT) && "Loop not left in LCSSA form after LICM!"); assert((L->isOutermost() || L->getParentLoop()->isLCSSAForm(*DT)) && "Parent loop not left in LCSSA form after LICM!"); diff --git a/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp b/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp index a87843d658a9ff..728d63fe2847eb 100644 --- a/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp +++ b/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp @@ -256,8 +256,8 @@ class ConstantTerminatorFoldingImpl { } } - // Sanity check: amount of dead and live loop blocks should match the total - // number of blocks in loop. + // Amount of dead and live loop blocks should match the total number of + // blocks in loop. assert(L.getNumBlocks() == LiveLoopBlocks.size() + DeadLoopBlocks.size() && "Malformed block sets?"); @@ -305,7 +305,6 @@ class ConstantTerminatorFoldingImpl { BlocksInLoopAfterFolding.insert(BB); } - // Sanity check: header must be in loop. assert(BlocksInLoopAfterFolding.count(L.getHeader()) && "Header not in loop?"); assert(BlocksInLoopAfterFolding.size() <= LiveLoopBlocks.size() && diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp index b0fb8daaba8fb6..8ebce785d4e91a 100644 --- a/llvm/lib/Transforms/Scalar/Reassociate.cpp +++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp @@ -494,7 +494,7 @@ static bool LinearizeExprTree(Instruction *I, SmallVector LeafOrder; // Ensure deterministic leaf output order. #ifndef NDEBUG - SmallPtrSet Visited; // For sanity checking the iteration scheme. + SmallPtrSet Visited; // For checking the iteration scheme. #endif while (!Worklist.empty()) { std::pair P = Worklist.pop_back_val(); diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp index 86d3620c312ecf..3799d2dd1cf27d 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -227,8 +227,7 @@ static bool iterativelySimplifyCFG(Function &F, const TargetTransformInfo &TTI, unsigned IterCnt = 0; (void)IterCnt; while (LocalChange) { - assert(IterCnt++ < 1000 && - "Sanity: iterative simplification didn't converge!"); + assert(IterCnt++ < 1000 && "Iterative simplification didn't converge!"); LocalChange = false; // Loop over all of the basic blocks and remove them if they are unneeded. diff --git a/llvm/lib/Transforms/Utils/GuardUtils.cpp b/llvm/lib/Transforms/Utils/GuardUtils.cpp index 4dbcbf80d3da46..7c310f16d46e21 100644 --- a/llvm/lib/Transforms/Utils/GuardUtils.cpp +++ b/llvm/lib/Transforms/Utils/GuardUtils.cpp @@ -74,7 +74,7 @@ void llvm::makeGuardControlFlowExplicit(Function *DeoptIntrinsic, {}, {}, nullptr, "widenable_cond"); CheckBI->setCondition(B.CreateAnd(CheckBI->getCondition(), WC, "exiplicit_guard_cond")); - assert(isWidenableBranch(CheckBI) && "sanity check"); + assert(isWidenableBranch(CheckBI) && "Branch must be widenable."); } } diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index f4776589910f2f..997667810580b8 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -1218,10 +1218,9 @@ static void AddReturnAttributes(CallBase &CB, ValueToValueMapTy &VMap) { if (!RI || !isa(RI->getOperand(0))) continue; auto *RetVal = cast(RI->getOperand(0)); - // Sanity check that the cloned RetVal exists and is a call, otherwise we - // cannot add the attributes on the cloned RetVal. - // Simplification during inlining could have transformed the cloned - // instruction. + // Check that the cloned RetVal exists and is a call, otherwise we cannot + // add the attributes on the cloned RetVal. Simplification during inlining + // could have transformed the cloned instruction. auto *NewRetVal = dyn_cast_or_null(VMap.lookup(RetVal)); if (!NewRetVal) continue;