Lines Matching refs:Assert

580 #define Assert(C, ...) \
590 Assert(I.getOperand(i) != nullptr, "Operand is null", &I);
608 Assert(!GV.isDeclaration() || GV.hasValidDeclarationLinkage(),
612 Assert(GO->getAlignment() <= Value::MaximumAlignment,
614 Assert(!GV.hasAppendingLinkage() || isa<GlobalVariable>(GV),
619 Assert(GVar && GVar->getValueType()->isArrayTy(),
624 Assert(!GV.hasComdat(), "Declaration may not be in a Comdat!", &GV);
627 Assert(!GV.isDSOLocal(),
630 Assert((GV.isDeclaration() &&
637 Assert(GV.isDSOLocal(),
664 Assert(GV.getInitializer()->getType() == GV.getValueType(),
671 Assert(GV.getInitializer()->isNullValue(),
673 Assert(!GV.isConstant(), "'common' global may not be marked constant!",
675 Assert(!GV.hasComdat(), "'common' global may not be in a Comdat!", &GV);
681 Assert(!GV.hasInitializer() || GV.hasAppendingLinkage(),
690 Assert(STy &&
695 Assert(STy->getNumElements() == 3,
699 Assert(ETy->isPointerTy() &&
707 Assert(!GV.hasInitializer() || GV.hasAppendingLinkage(),
712 Assert(PTy, "wrong type for intrinsic global variable", &GV);
716 Assert(InitArray, "wrong initalizer for intrinsic global variable",
720 Assert(isa<GlobalVariable>(V) || isa<Function>(V) ||
723 Assert(V->hasName(), "members of llvm.used must be named", V);
744 Assert(!isa<ScalableVectorType>(GV.getValueType()),
748 Assert(!STy->containsScalableVectorType(),
771 Assert(!GV->isDeclarationForLinker(), "Alias must point to a definition",
775 Assert(Visited.insert(GA2).second, "Aliases cannot form a cycle", &GA);
777 Assert(!GA2->isInterposable(), "Alias cannot point to an interposable alias",
799 Assert(GlobalAlias::isValidLinkage(GA.getLinkage()),
804 Assert(Aliasee, "Aliasee cannot be NULL!", &GA);
805 Assert(GA.getType() == Aliasee->getType(),
808 Assert(isa<GlobalValue>(Aliasee) || isa<ConstantExpr>(Aliasee),
840 Assert(&MD.getContext() == &Context,
858 Assert(!isa<LocalAsMetadata>(Op), "Invalid operand for global metadata!",
873 Assert(!MD.isTemporary(), "Expected no forward declarations!", &MD);
874 Assert(MD.isResolved(), "All nodes should be resolved!", &MD);
878 Assert(MD.getValue(), "Expected valid value", &MD);
879 Assert(!MD.getValue()->getType()->isMetadataTy(),
886 Assert(F, "function-local metadata used outside a function", L);
892 Assert(I->getParent(), "function-local metadata not in basic block", L, I);
900 Assert(ActualF == F, "function-local metadata used in wrong function", L);
1395 // Assert only if the global variable is not an extern
1466 Assert(!GV->hasPrivateLinkage(),
1478 Assert(N->getNumOperands() == 1,
1480 Assert(dyn_cast_or_null<MDString>(N->getOperand(0)),
1496 Assert(N->getNumOperands() == 1,
1498 Assert(dyn_cast_or_null<MDString>(N->getOperand(0)),
1542 Assert(Op->getNumOperands() == 3,
1546 Assert(
1550 Assert(false,
1555 Assert(ID, "invalid ID operand in module flag (expected metadata string)",
1567 Assert(mdconst::dyn_extract_or_null<ConstantInt>(Op->getOperand(2)),
1577 Assert(Value && Value->getNumOperands() == 2,
1580 Assert(isa<MDString>(Value->getOperand(0)),
1594 Assert(isa<MDNode>(Op->getOperand(2)),
1605 Assert(Inserted,
1612 Assert(Value, "wchar_size metadata requires constant integer argument");
1619 Assert(M.getNamedMetadata("llvm.linker.options"),
1626 Assert(Value,
1641 Assert(F && isa<Function>(F->getValue()->stripPointerCasts()),
1645 Assert(Node && Node->getNumOperands() == 3, "expected a MDNode triple", MDO);
1649 Assert(Count && Count->getType()->isIntegerTy(),
1772 Assert(Attrs.getNumAttributes() == 1,
1786 Assert(AttrCount <= 1,
1791 Assert(!(Attrs.hasAttribute(Attribute::InAlloca) &&
1797 Assert(!(Attrs.hasAttribute(Attribute::StructRet) &&
1803 Assert(!(Attrs.hasAttribute(Attribute::ZExt) &&
1809 Assert(!(Attrs.hasAttribute(Attribute::ReadNone) &&
1815 Assert(!(Attrs.hasAttribute(Attribute::ReadNone) &&
1821 Assert(!(Attrs.hasAttribute(Attribute::ReadOnly) &&
1827 Assert(!(Attrs.hasAttribute(Attribute::NoInline) &&
1834 Assert(!AttrBuilder(Attrs).overlaps(IncompatibleAttrs),
1842 Assert(!Attrs.hasAttribute(Attribute::ByVal) &&
1851 Assert(!Attrs.hasAttribute(Attribute::SwiftError),
1857 Assert(Attrs.getByRefType() == PTy->getElementType(),
1862 Assert(Attrs.getByValType() == PTy->getElementType(),
1867 Assert(Attrs.getPreallocatedType() == PTy->getElementType(),
1872 Assert(Attrs.getInAllocaType() == PTy->getElementType(),
1876 Assert(!Attrs.hasAttribute(Attribute::ByVal),
1879 Assert(!Attrs.hasAttribute(Attribute::ByRef),
1882 Assert(!Attrs.hasAttribute(Attribute::SwiftError),
1897 Assert(Attrs.hasParentContext(Context),
1900 Assert(!AttrSet.hasAttributes() || AttrSet.hasParentContext(Context),
1903 Assert(A.hasParentContext(Context),
1918 Assert((!RetAttrs.hasAttribute(Attribute::ByVal) &&
1935 Assert((!RetAttrs.hasAttribute(Attribute::ReadOnly) &&
1949 Assert(!ArgAttrs.hasAttribute(Attribute::ImmArg),
1956 Assert(!SawNest, "More than one parameter has attribute nest!", V);
1961 Assert(!SawReturned, "More than one parameter has attribute returned!",
1963 Assert(Ty->canLosslesslyBitCastTo(FT->getReturnType()),
1970 Assert(!SawSRet, "Cannot have multiple 'sret' parameters!", V);
1971 Assert(i == 0 || i == 1,
1977 Assert(!SawSwiftSelf, "Cannot have multiple 'swiftself' parameters!", V);
1982 Assert(!SawSwiftAsync, "Cannot have multiple 'swiftasync' parameters!", V);
1987 Assert(!SawSwiftError, "Cannot have multiple 'swifterror' parameters!",
1993 Assert(i == FT->getNumParams() - 1,
2003 Assert(!(Attrs.hasFnAttribute(Attribute::ReadNone) &&
2007 Assert(!(Attrs.hasFnAttribute(Attribute::ReadNone) &&
2011 Assert(!(Attrs.hasFnAttribute(Attribute::ReadOnly) &&
2015 Assert(!(Attrs.hasFnAttribute(Attribute::ReadNone) &&
2021 Assert(!(Attrs.hasFnAttribute(Attribute::ReadNone) &&
2025 Assert(!(Attrs.hasFnAttribute(Attribute::NoInline) &&
2030 Assert(Attrs.hasFnAttribute(Attribute::NoInline),
2033 Assert(!Attrs.hasFnAttribute(Attribute::OptimizeForSize),
2036 Assert(!Attrs.hasFnAttribute(Attribute::MinSize),
2042 Assert(GV->hasGlobalUnnamedAddr(),
2115 Assert(MD->getNumOperands() >= 2,
2119 Assert(MD->getOperand(0) != nullptr, "first operand should not be null",
2121 Assert(isa<MDString>(MD->getOperand(0)),
2125 Assert(ProfName.equals("function_entry_count") ||
2132 Assert(MD->getOperand(1) != nullptr, "second operand should not be null",
2134 Assert(isa<ConstantAsMetadata>(MD->getOperand(1)),
2157 Assert(GV->getParent() == &M, "Referencing global in another module!",
2176 Assert(CastInst::castIsValid(Instruction::BitCast, CE->getOperand(0),
2188 Assert(
2206 Assert(!Call.doesNotAccessMemory() && !Call.onlyReadsMemory() &&
2215 Assert(NumPatchBytes >= 0,
2222 Assert(PT && PT->getElementType()->isFunctionTy(),
2227 Assert(NumCallArgs >= 0,
2233 Assert(NumCallArgs >= NumParams,
2237 Assert(TargetFuncType->getReturnType()->isVoidTy(),
2242 Assert(NumCallArgs == NumParams,
2247 Assert((Flags & ~(uint64_t)StatepointFlags::MaskAll) == 0,
2256 Assert(ArgType == ParamType,
2263 Assert(!ArgAttrs.hasAttribute(Attribute::StructRet),
2272 Assert(isa<ConstantInt>(NumTransitionArgsV),
2278 Assert(NumTransitionArgs == 0,
2283 Assert(isa<ConstantInt>(NumDeoptArgsV),
2288 Assert(NumDeoptArgs == 0,
2292 Assert(ExpectedNumArgs == (int)Call.arg_size(),
2300 Assert(UserCall, "illegal use of statepoint token", Call, U);
2303 Assert(isa<GCRelocateInst>(UserCall) || isa<GCResultInst>(UserCall),
2308 Assert(UserCall->getArgOperand(0) == &Call,
2311 Assert(UserCall->getArgOperand(0) == &Call,
2331 Assert(MaxRecoveredIndex <= EscapedObjectCount,
2372 Assert(false, "EH pads can't handle each other's exceptions",
2401 Assert(&Context == &F.getContext(),
2404 Assert(!F.hasCommonLinkage(), "Functions may not have common linkage", &F);
2405 Assert(FT->getNumParams() == NumArgs,
2408 Assert(F.getReturnType()->isFirstClassType() ||
2412 Assert(!F.hasStructRetAttr() || F.getReturnType()->isVoidTy(),
2417 Assert(verifyAttributeCount(Attrs, FT->getNumParams()),
2429 Assert(!Attrs.hasFnAttribute(Attribute::Builtin),
2440 Assert(F.arg_empty() || Attrs.hasParamAttribute(0, Attribute::ByVal),
2446 Assert(F.getReturnType()->isVoidTy(),
2454 Assert(!F.hasStructRetAttr(),
2460 Assert(!Attrs.hasParamAttribute(i, Attribute::ByVal),
2462 Assert(!Attrs.hasParamAttribute(i, Attribute::Preallocated),
2464 Assert(!Attrs.hasParamAttribute(i, Attribute::InAlloca),
2470 Assert(Arg.getType()->getPointerAddressSpace() != StackAS,
2484 Assert(!F.isVarArg(), "Calling convention does not support varargs or "
2493 Assert(Arg.getType() == FT->getParamType(i),
2496 Assert(Arg.getType()->isFirstClassType(),
2499 Assert(!Arg.getType()->isMetadataTy(),
2501 Assert(!Arg.getType()->isTokenTy(),
2503 Assert(!Arg.getType()->isX86_AMXTy(),
2515 Assert(!F.getReturnType()->isTokenTy(),
2517 Assert(!F.getReturnType()->isX86_AMXTy(),
2531 Assert(Per->getParent() == F.getParent(),
2538 Assert(MDs.empty(), "unmaterialized function cannot have metadata", &F,
2547 Assert(I.first != LLVMContext::MD_prof,
2553 Assert(!F.hasPersonalityFn(),
2558 Assert(!isLLVMdotName, "llvm intrinsics cannot be defined!", &F);
2562 Assert(pred_empty(Entry),
2567 Assert(!BlockAddress::lookup(Entry)->isConstantUsed(),
2599 Assert(NumProfAttachments == 1,
2616 Assert(false, "Invalid user of intrinsic instruction!", U);
2644 Assert(Scope, "Failed to find DILocalScope", DL);
2678 Assert(BB.getTerminator(), "Basic Block does not have terminator!", &BB);
2687 Assert(PN.getNumIncomingValues() == Preds.size(),
2705 Assert(i == 0 || Values[i].first != Values[i - 1].first ||
2713 Assert(Values[i].first == Preds[i],
2723 Assert(I.getParent() == &BB, "Instruction has bogus parent pointer!");
2729 Assert(&I == I.getParent()->getTerminator(),
2736 Assert(BI.getCondition()->getType()->isIntegerTy(1),
2746 Assert(N == 0,
2751 Assert(N == 1 && F->getReturnType() == RI.getOperand(0)->getType(),
2767 Assert(Case.getCaseValue()->getType() == SwitchTy,
2769 Assert(Constants.insert(Case.getCaseValue()).second,
2777 Assert(BI.getAddress()->getType()->isPointerTy(),
2780 Assert(BI.getDestination(i)->getType()->isLabelTy(),
2787 Assert(CBI.isInlineAsm(), "Callbr is currently only used for asm-goto!",
2790 Assert(!IA->canThrow(), "Unwinding from Callbr is not allowed");
2792 Assert(CBI.getSuccessor(i)->getType()->isLabelTy(),
2795 Assert(i >= CBI.getNumArgOperands() || !isa<BasicBlock>(CBI.getOperand(i)),
2799 Assert(CBI.getOperand(i) != CBI.getOperand(j),
2808 Assert(ArgBBs.count(BB), "Indirect label missing from arglist.", &CBI);
2815 Assert(!SelectInst::areInvalidOperands(SI.getOperand(0), SI.getOperand(1),
2819 Assert(SI.getTrueValue()->getType() == SI.getType(),
2828 Assert(false, "User-defined operators should not live outside of a pass!", &I);
2840 Assert(SrcTy->isIntOrIntVectorTy(), "Trunc only operates on integer", &I);
2841 Assert(DestTy->isIntOrIntVectorTy(), "Trunc only produces integer", &I);
2842 Assert(SrcTy->isVectorTy() == DestTy->isVectorTy(),
2844 Assert(SrcBitSize > DestBitSize, "DestTy too big for Trunc", &I);
2855 Assert(SrcTy->isIntOrIntVectorTy(), "ZExt only operates on integer", &I);
2856 Assert(DestTy->isIntOrIntVectorTy(), "ZExt only produces an integer", &I);
2857 Assert(SrcTy->isVectorTy() == DestTy->isVectorTy(),
2862 Assert(SrcBitSize < DestBitSize, "Type too small for ZExt", &I);
2876 Assert(SrcTy->isIntOrIntVectorTy(), "SExt only operates on integer", &I);
2877 Assert(DestTy->isIntOrIntVectorTy(), "SExt only produces an integer", &I);
2878 Assert(SrcTy->isVectorTy() == DestTy->isVectorTy(),
2880 Assert(SrcBitSize < DestBitSize, "Type too small for SExt", &I);
2893 Assert(SrcTy->isFPOrFPVectorTy(), "FPTrunc only operates on FP", &I);
2894 Assert(DestTy->isFPOrFPVectorTy(), "FPTrunc only produces an FP", &I);
2895 Assert(SrcTy->isVectorTy() == DestTy->isVectorTy(),
2897 Assert(SrcBitSize > DestBitSize, "DestTy too big for FPTrunc", &I);
2911 Assert(SrcTy->isFPOrFPVectorTy(), "FPExt only operates on FP", &I);
2912 Assert(DestTy->isFPOrFPVectorTy(), "FPExt only produces an FP", &I);
2913 Assert(SrcTy->isVectorTy() == DestTy->isVectorTy(),
2915 Assert(SrcBitSize < DestBitSize, "DestTy too small for FPExt", &I);
2928 Assert(SrcVec == DstVec,
2930 Assert(SrcTy->isIntOrIntVectorTy(),
2932 Assert(DestTy->isFPOrFPVectorTy(), "UIToFP result must be FP or FP vector",
2936 Assert(cast<VectorType>(SrcTy)->getElementCount() ==
2951 Assert(SrcVec == DstVec,
2953 Assert(SrcTy->isIntOrIntVectorTy(),
2955 Assert(DestTy->isFPOrFPVectorTy(), "SIToFP result must be FP or FP vector",
2959 Assert(cast<VectorType>(SrcTy)->getElementCount() ==
2974 Assert(SrcVec == DstVec,
2976 Assert(SrcTy->isFPOrFPVectorTy(), "FPToUI source must be FP or FP vector",
2978 Assert(DestTy->isIntOrIntVectorTy(),
2982 Assert(cast<VectorType>(SrcTy)->getElementCount() ==
2997 Assert(SrcVec == DstVec,
2999 Assert(SrcTy->isFPOrFPVectorTy(), "FPToSI source must be FP or FP vector",
3001 Assert(DestTy->isIntOrIntVectorTy(),
3005 Assert(cast<VectorType>(SrcTy)->getElementCount() ==
3017 Assert(SrcTy->isPtrOrPtrVectorTy(), "PtrToInt source must be pointer", &I);
3020 Assert(!DL.isNonIntegralPointerType(PTy),
3023 Assert(DestTy->isIntOrIntVectorTy(), "PtrToInt result must be integral", &I);
3024 Assert(SrcTy->isVectorTy() == DestTy->isVectorTy(), "PtrToInt type mismatch",
3030 Assert(VSrc->getElementCount() == VDest->getElementCount(),
3042 Assert(SrcTy->isIntOrIntVectorTy(),
3044 Assert(DestTy->isPtrOrPtrVectorTy(), "IntToPtr result must be a pointer", &I);
3047 Assert(!DL.isNonIntegralPointerType(PTy),
3050 Assert(SrcTy->isVectorTy() == DestTy->isVectorTy(), "IntToPtr type mismatch",
3055 Assert(VSrc->getElementCount() == VDest->getElementCount(),
3062 Assert(
3072 Assert(SrcTy->isPtrOrPtrVectorTy(), "AddrSpaceCast source must be a pointer",
3074 Assert(DestTy->isPtrOrPtrVectorTy(), "AddrSpaceCast result must be a pointer",
3076 Assert(SrcTy->getPointerAddressSpace() != DestTy->getPointerAddressSpace(),
3079 Assert(SrcVTy->getElementCount() ==
3092 Assert(&PN == &PN.getParent()->front() ||
3097 Assert(!PN.getType()->isTokenTy(), "PHI nodes cannot have token type!");
3102 Assert(PN.getType() == IncValue->getType(),
3112 Assert(Call.getCalledOperand()->getType()->isPointerTy(),
3116 Assert(FPTy->getElementType()->isFunctionTy(),
3119 Assert(FPTy->getElementType() == Call.getFunctionType(),
3126 Assert(Call.arg_size() >= FTy->getNumParams(),
3130 Assert(Call.arg_size() == FTy->getNumParams(),
3135 Assert(Call.getArgOperand(i)->getType() == FTy->getParamType(i),
3141 Assert(verifyAttributeCount(Attrs, Call.arg_size()),
3153 Assert(Callee && Callee->isSpeculatable(),
3158 Assert(Call.getCalledFunction()->getIntrinsicID() ==
3173 Assert(AI->isUsedWithInAlloca(),
3184 Assert(AI->isSwiftError(),
3189 Assert(ArgI,
3192 Assert(ArgI->hasSwiftErrorAttr(),
3200 Assert(Callee && Callee->hasParamAttribute(i, Attribute::ImmArg),
3207 Assert(isa<ConstantInt>(ArgVal) || isa<ConstantFP>(ArgVal),
3216 Assert(hasOB != isMustTail,
3242 Assert(!SawNest, "More than one parameter has attribute nest!", Call);
3247 Assert(!SawReturned, "More than one parameter has attribute returned!",
3249 Assert(Ty->canLosslesslyBitCastTo(FTy->getReturnType()),
3261 Assert(!ArgAttrs.hasAttribute(Attribute::StructRet),
3266 Assert(Idx == Call.arg_size() - 1,
3274 Assert(!ParamTy->isMetadataTy(),
3276 Assert(!ParamTy->isTokenTy(),
3283 Assert(!FTy->getReturnType()->isTokenTy(),
3285 Assert(!FTy->getReturnType()->isX86_AMXTy(),
3304 Assert(!FoundDeoptBundle, "Multiple deopt operand bundles", Call);
3307 Assert(!FoundGCTransitionBundle, "Multiple gc-transition operand bundles",
3311 Assert(!FoundFuncletBundle, "Multiple funclet operand bundles", Call);
3313 Assert(BU.Inputs.size() == 1,
3315 Assert(isa<FuncletPadInst>(BU.Inputs.front()),
3319 Assert(!FoundCFGuardTargetBundle,
3322 Assert(BU.Inputs.size() == 1,
3325 Assert(!FoundPreallocatedBundle, "Multiple preallocated operand bundles",
3328 Assert(BU.Inputs.size() == 1,
3331 Assert(Input &&
3337 Assert(!FoundGCLiveBundle, "Multiple gc-live operand bundles",
3341 Assert(!FoundAttachedCallBundle,
3348 Assert(FTy->getReturnType()->isPointerTy(),
3399 Assert(!CI.isInlineAsm(), "cannot use musttail call with inline asm", &CI);
3408 Assert(CallerTy->getNumParams() == CalleeTy->getNumParams(),
3412 Assert(
3417 Assert(CallerTy->isVarArg() == CalleeTy->isVarArg(),
3419 Assert(isTypeCongruent(CallerTy->getReturnType(), CalleeTy->getReturnType()),
3423 Assert(F->getCallingConv() == CI.getCallingConv(),
3433 Assert(CallerABIAttrs == CalleeABIAttrs,
3448 Assert(BI->getOperand(0) == RetVal,
3456 Assert(Ret, "musttail call must precede a ret with an optional bitcast",
3458 Assert(!Ret->getReturnValue() || Ret->getReturnValue() == RetVal,
3474 Assert(
3485 Assert(U.getType() == U.getOperand(0)->getType(),
3494 Assert(U.getType()->isFPOrFPVectorTy(),
3508 Assert(B.getOperand(0)->getType() == B.getOperand(1)->getType(),
3521 Assert(B.getType()->isIntOrIntVectorTy(),
3523 Assert(B.getType() == B.getOperand(0)->getType(),
3535 Assert(B.getType()->isFPOrFPVectorTy(),
3539 Assert(B.getType() == B.getOperand(0)->getType(),
3548 Assert(B.getType()->isIntOrIntVectorTy(),
3550 Assert(B.getType() == B.getOperand(0)->getType(),
3557 Assert(B.getType()->isIntOrIntVectorTy(),
3559 Assert(B.getType() == B.getOperand(0)->getType(),
3573 Assert(Op0Ty == Op1Ty,
3576 Assert(Op0Ty->isIntOrIntVectorTy() || Op0Ty->isPtrOrPtrVectorTy(),
3579 Assert(IC.isIntPredicate(),
3589 Assert(Op0Ty == Op1Ty,
3592 Assert(Op0Ty->isFPOrFPVectorTy(),
3595 Assert(FC.isFPPredicate(),
3602 Assert(
3609 Assert(InsertElementInst::isValidOperands(IE.getOperand(0), IE.getOperand(1),
3616 Assert(ShuffleVectorInst::isValidOperands(SV.getOperand(0), SV.getOperand(1),
3625 Assert(isa<PointerType>(TargetTy),
3627 Assert(GEP.getSourceElementType()->isSized(), "GEP into unsized type!", &GEP);
3630 Assert(all_of(
3635 Assert(ElTy, "Invalid indices for GEP pointer type!", &GEP);
3637 Assert(GEP.getType()->isPtrOrPtrVectorTy() &&
3645 Assert(
3653 Assert(IndexWidth == GEPWidth, "Invalid GEP index vector width", &GEP);
3655 Assert(IndexTy->isIntOrIntVectorTy(),
3661 Assert(GEP.getAddressSpace() == PTy->getAddressSpace(),
3677 Assert(NumOperands % 2 == 0, "Unfinished range!", Range);
3679 Assert(NumRanges >= 1, "It should have at least one range!", Range);
3685 Assert(Low, "The lower limit must be an integer!", Low);
3688 Assert(High, "The upper limit must be an integer!", High);
3689 Assert(High->getType() == Low->getType() && High->getType() == Ty,
3695 Assert(!CurRange.isEmptySet() && !CurRange.isFullSet(),
3698 Assert(CurRange.intersectWith(LastRange).isEmptySet(),
3700 Assert(LowV.sgt(LastRange.getLower()), "Intervals are not in order",
3702 Assert(!isContiguous(CurRange, LastRange), "Intervals are contiguous",
3713 Assert(FirstRange.intersectWith(LastRange).isEmptySet(),
3715 Assert(!isContiguous(FirstRange, LastRange), "Intervals are contiguous",
3722 Assert(Size >= 8, "atomic memory access' size must be byte-sized", Ty, I);
3723 Assert(!(Size & (Size - 1)),
3729 Assert(PTy, "Load operand must be a pointer.", &LI);
3731 Assert(LI.getAlignment() <= Value::MaximumAlignment,
3733 Assert(ElTy->isSized(), "loading unsized types is not allowed", &LI);
3735 Assert(LI.getOrdering() != AtomicOrdering::Release &&
3738 Assert(LI.getAlignment() != 0,
3740 Assert(ElTy->isIntOrPtrTy() || ElTy->isFloatingPointTy(),
3746 Assert(LI.getSyncScopeID() == SyncScope::System,
3755 Assert(PTy, "Store operand must be a pointer.", &SI);
3757 Assert(PTy->isOpaqueOrPointeeTypeMatches(ElTy),
3759 Assert(SI.getAlignment() <= Value::MaximumAlignment,
3761 Assert(ElTy->isSized(), "storing unsized types is not allowed", &SI);
3763 Assert(SI.getOrdering() != AtomicOrdering::Acquire &&
3766 Assert(SI.getAlignment() != 0,
3768 Assert(ElTy->isIntOrPtrTy() || ElTy->isFloatingPointTy(),
3774 Assert(SI.getSyncScopeID() == SyncScope::System,
3785 Assert(Call.paramHasAttr(I.index(), Attribute::SwiftError),
3797 Assert(isa<LoadInst>(U) || isa<StoreInst>(U) || isa<CallInst>(U) ||
3804 Assert(StoreI->getOperand(1) == SwiftErrorVal,
3814 Assert(AI.getAllocatedType()->isSized(&Visited),
3816 Assert(AI.getArraySize()->getType()->isIntegerTy(),
3818 Assert(AI.getAlignment() <= Value::MaximumAlignment,
3830 Assert(ElTy->isIntOrPtrTy(),
3837 Assert(RMWI.getOrdering() != AtomicOrdering::Unordered,
3842 Assert(ElTy->isIntegerTy() || ElTy->isFloatingPointTy(), "atomicrmw " +
3847 Assert(ElTy->isFloatingPointTy(), "atomicrmw " +
3852 Assert(ElTy->isIntegerTy(), "atomicrmw " +
3858 Assert(AtomicRMWInst::FIRST_BINOP <= Op && Op <= AtomicRMWInst::LAST_BINOP,
3865 Assert(Ordering == AtomicOrdering::Acquire ||
3876 Assert(ExtractValueInst::getIndexedType(EVI.getAggregateOperand()->getType(),
3884 Assert(ExtractValueInst::getIndexedType(IVI.getAggregateOperand()->getType(),
3905 Assert(BB != &F->getEntryBlock(), "EH pad cannot be in entry block.", &I);
3913 Assert(II && II->getUnwindDest() == BB && II->getNormalDest() != BB,
3922 Assert(BB->getUniquePredecessor() == CPI->getCatchSwitch()->getParent(),
3926 Assert(BB != CPI->getCatchSwitch()->getUnwindDest(),
3940 Assert(II->getUnwindDest() == BB && II->getNormalDest() != BB,
3948 Assert(FromPad != ToPadParent, "A cleanupret must exit its cleanup", CRI);
3952 Assert(false, "EH pad must be jumped to via an unwind edge", ToPad, TI);
3958 Assert(FromPad != ToPad,
3964 Assert(!isa<ConstantTokenNone>(FromPad),
3966 Assert(Seen.insert(FromPad).second,
3975 Assert(LPI.getNumClauses() > 0 || LPI.isCleanup(),
3983 Assert(LandingPadResultTy == LPI.getType(),
3989 Assert(F->hasPersonalityFn(),
3994 Assert(LPI.getParent()->getLandingPadInst() == &LPI,
4001 Assert(isa<PointerType>(Clause->getType()),
4004 Assert(LPI.isFilter(i), "Clause is neither catch nor filter!", &LPI);
4005 Assert(isa<ConstantArray>(Clause) || isa<ConstantAggregateZero>(Clause),
4014 Assert(RI.getFunction()->hasPersonalityFn(),
4020 Assert(LandingPadResultTy == RI.getValue()->getType(),
4032 Assert(F->hasPersonalityFn(),
4035 Assert(isa<CatchSwitchInst>(CPI.getParentPad()),
4041 Assert(BB->getFirstNonPHI() == &CPI,
4049 Assert(isa<CatchPadInst>(CatchReturn.getOperand(0)),
4060 Assert(F->hasPersonalityFn(),
4065 Assert(BB->getFirstNonPHI() == &CPI,
4070 Assert(isa<ConstantTokenNone>(ParentPad) || isa<FuncletPadInst>(ParentPad),
4085 Assert(Seen.insert(CurrentPad).second,
4114 Assert(isa<CatchReturnInst>(U), "Bogus funclet pad use", U);
4164 Assert(UnwindPad == FirstUnwindPad, "Unwind edges out of a funclet "
4226 Assert(SwitchUnwindPad == FirstUnwindPad,
4240 Assert(F->hasPersonalityFn(),
4246 Assert(BB->getFirstNonPHI() == &CatchSwitch,
4251 Assert(isa<ConstantTokenNone>(ParentPad) || isa<FuncletPadInst>(ParentPad),
4256 Assert(I->isEHPad() && !isa<LandingPadInst>(I),
4266 Assert(CatchSwitch.getNumHandlers() != 0,
4270 Assert(isa<CatchPadInst>(Handler->getFirstNonPHI()),
4279 Assert(isa<CleanupPadInst>(CRI.getOperand(0)),
4285 Assert(I->isEHPad() && !isa<LandingPadInst>(I),
4315 Assert(DT.dominates(Op, U),
4320 Assert(I.getType()->isPointerTy(), "dereferenceable, dereferenceable_or_null "
4322 Assert((isa<LoadInst>(I) || isa<IntToPtrInst>(I)),
4325 Assert(MD->getNumOperands() == 1, "dereferenceable, dereferenceable_or_null "
4328 Assert(CI && CI->getType()->isIntegerTy(64), "dereferenceable, "
4333 Assert(MD->getNumOperands() >= 2,
4337 Assert(MD->getOperand(0) != nullptr, "first operand should not be null", MD);
4338 Assert(isa<MDString>(MD->getOperand(0)),
4346 Assert(MD->getNumOperands() == 2 || MD->getNumOperands() == 3,
4364 Assert(MD->getNumOperands() == 1 + ExpectedNumOperands,
4369 Assert(MDO, "second operand should not be null", MD);
4370 Assert(mdconst::dyn_extract<ConstantInt>(MDO),
4377 Assert(isa<MDTuple>(Annotation), "annotation must be a tuple");
4378 Assert(Annotation->getNumOperands() >= 1,
4381 Assert(isa<MDString>(Op.get()), "operands must be strings");
4388 Assert(BB, "Instruction not embedded in basic block!", &I);
4392 Assert(U != (User *)&I || !DT.isReachableFromEntry(BB),
4398 Assert(!I.getType()->isVoidTy() || !I.hasName(),
4403 Assert(I.getType()->isVoidTy() || I.getType()->isFirstClassType(),
4408 Assert(!I.getType()->isMetadataTy() || isa<CallInst>(I) || isa<InvokeInst>(I),
4416 Assert(Used->getParent() != nullptr,
4431 Assert(I.getOperand(i) != nullptr, "Instruction has null operand!", &I);
4436 Assert(false, "Instruction operands must be first-class values!", &I);
4442 Assert(!F->isIntrinsic() ||
4445 Assert(
4461 Assert(F->getParent() == &M, "Referencing function in another module!",
4464 Assert(OpBB->getParent() == BB->getParent(),
4467 Assert(OpArg->getParent() == BB->getParent(),
4470 Assert(GV->getParent() == &M, "Referencing global in another module!", &I,
4475 Assert(CBI && &CBI->getCalledOperandUse() == &I.getOperandUse(i),
4490 Assert(I.getType()->isFPOrFPVectorTy(),
4492 Assert(MD->getNumOperands() == 1, "fpmath takes one operand!", &I);
4496 Assert(&Accuracy.getSemantics() == &APFloat::IEEEsingle(),
4498 Assert(Accuracy.isFiniteNonZero() && !Accuracy.isNegative(),
4501 Assert(false, "invalid fpmath accuracy!", &I);
4506 Assert(isa<LoadInst>(I) || isa<CallInst>(I) || isa<InvokeInst>(I),
4512 Assert(I.getType()->isPointerTy(), "nonnull applies only to pointer types",
4514 Assert(isa<LoadInst>(I),
4530 Assert(I.getType()->isPointerTy(), "align applies only to pointer types",
4532 Assert(isa<LoadInst>(I), "align applies only to load instructions, "
4534 Assert(AlignMD->getNumOperands() == 1, "align takes one operand!", &I);
4536 Assert(CI && CI->getType()->isIntegerTy(64),
4539 Assert(isPowerOf2_64(Align),
4541 Assert(Align <= Value::MaximumAlignment,
4578 Assert(IF->isDeclaration(), "Intrinsic functions should never be defined!",
4594 Assert(Res != Intrinsic::MatchIntrinsicTypes_NoMatchRet,
4596 Assert(Res != Intrinsic::MatchIntrinsicTypes_NoMatchArg,
4601 Assert(!Intrinsic::matchIntrinsicVarArg(IsVarArg, TableRef),
4604 Assert(!Intrinsic::matchIntrinsicVarArg(IsVarArg, TableRef),
4608 Assert(TableRef.empty(), "Intrinsic has too few arguments!", IF);
4616 Assert(ExpectedName == IF->getName(),
4628 Assert(!Const->getType()->isX86_AMXTy(),
4637 Assert(Elem.Tag->getKey() == "ignore" ||
4644 Assert(ArgCount <= 3 && ArgCount >= 2,
4646 Assert(Call.getOperand(Elem.Begin)->getType()->isPointerTy(),
4648 Assert(Call.getOperand(Elem.Begin + 1)->getType()->isIntegerTy(),
4651 Assert(Call.getOperand(Elem.Begin + 2)->getType()->isIntegerTy(),
4655 Assert(ArgCount <= 2, "to many arguments");
4659 Assert(ArgCount == 2, "this attribute should have 2 arguments");
4660 Assert(isa<ConstantInt>(Call.getOperand(Elem.Begin + 1)),
4663 Assert((ArgCount) == 0, "this attribute has no argument");
4665 Assert((ArgCount) == 1, "this attribute should have one argument");
4675 Assert(GV && GV->isConstant() && GV->hasDefinitiveInitializer(),
4679 Assert(isa<ConstantStruct>(Init) || isa<ConstantArray>(Init),
4690 Assert(isa<MetadataAsValue>(Call.getArgOperand(0)),
4711 Assert(IsValidAlignment(MI->getDestAlignment()),
4715 Assert(IsValidAlignment(MTI->getSourceAlignment()),
4730 Assert(ElementSizeVal.isPowerOf2(),
4739 Assert(IsValidAlignment(DstAlignment),
4743 Assert(IsValidAlignment(SrcAlignment),
4750 Assert(NumArgs != nullptr,
4755 Assert(UseCall != nullptr,
4760 Assert(AllocArgIndex != nullptr,
4763 Assert(AllocArgIndexInt.sge(0) &&
4772 Assert(!FoundCall, "Can have at most one call corresponding to a "
4781 Assert(NumPreallocatedArgs != 0,
4784 Assert(NumArgs->equalsInt(NumPreallocatedArgs),
4798 Assert(PreallocatedBundle,
4801 Assert(PreallocatedBundle->Inputs.front().get() == &Call,
4810 Assert(Token && Token->getCalledFunction()->getIntrinsicID() ==
4814 Assert(Call.hasFnAttr(Attribute::Preallocated),
4821 Assert(Token && Token->getCalledFunction()->getIntrinsicID() ==
4833 Assert(AI, "llvm.gcroot parameter #1 must be an alloca.", Call);
4834 Assert(isa<Constant>(Call.getArgOperand(1)),
4837 Assert(!isa<ConstantPointerNull>(Call.getArgOperand(1)),
4844 Assert(Call.getParent()->getParent()->hasGC(),
4848 Assert(isa<Function>(Call.getArgOperand(1)->stripPointerCasts()),
4853 Assert(cast<ConstantInt>(Call.getArgOperand(1))->getZExtValue() < 2 &&
4858 Assert(isa<AllocaInst>(Call.getArgOperand(1)->stripPointerCasts()),
4863 Assert(BB == &BB->getParent()->front(),
4865 Assert(!SawFrameEscape,
4871 Assert(AI && AI->isStaticAlloca(),
4881 Assert(Fn && !Fn->isDeclaration(),
4894 Assert(!CI->isInlineAsm(),
4896 Assert(Call.getParent()->getParent()->hasGC(),
4902 Assert(Call.getParent()->getParent()->hasGC(),
4908 Assert(StatepointFn && StatepointFn->isDeclaration() &&
4914 // Assert that result type matches wrapped callee.
4918 Assert(Call.getType() == TargetFuncType->getReturnType(),
4923 Assert(Call.getNumArgOperands() == 3, "wrong number of arguments", Call);
4925 Assert(isa<PointerType>(Call.getType()->getScalarType()),
4939 Assert(InvokeBB, "safepoints should have unique landingpads",
4941 Assert(InvokeBB->getTerminator(), "safepoint block should be well formed",
4943 Assert(isa<GCStatepointInst>(InvokeBB->getTerminator()),
4950 Assert(isa<GCStatepointInst>(Token),
4960 Assert(isa<ConstantInt>(Base),
4964 Assert(isa<ConstantInt>(Derived),
4972 Assert(BaseIndex < Opt->Inputs.size(),
4974 Assert(DerivedIndex < Opt->Inputs.size(),
4983 Assert(Relocate.getDerivedPtr()->getType()->isPtrOrPtrVectorTy(),
4988 Assert(ResultType->isVectorTy() == DerivedType->isVectorTy(),
4991 Assert(
5000 Assert(isa<CatchPadInst>(Call.getArgOperand(0)),
5005 Assert(Call.getType()->isVectorTy(), "get_active_lane_mask: must return a "
5008 Assert(ElemTy->isIntegerTy(1), "get_active_lane_mask: element type is not "
5013 Assert(Call.getType()->isVectorTy(), "masked_load: must return a vector",
5020 Assert(Mask->getType()->isVectorTy(), "masked_load: mask must be vector",
5022 Assert(Alignment->getValue().isPowerOf2(),
5027 Assert(DataTy == Call.getType(),
5029 Assert(PassThru->getType() == DataTy,
5031 Assert(cast<VectorType>(Mask->getType())->getElementCount() ==
5041 Assert(Mask->getType()->isVectorTy(), "masked_store: mask must be vector",
5043 Assert(Alignment->getValue().isPowerOf2(),
5048 Assert(DataTy == Val->getType(),
5050 Assert(cast<VectorType>(Mask->getType())->getElementCount() ==
5059 Assert(Alignment.isNullValue() || Alignment.isPowerOf2(),
5066 Assert(Alignment.isNullValue() || Alignment.isPowerOf2(),
5072 Assert(isa<CallInst>(Call), "experimental_guard cannot be invoked", Call);
5073 Assert(Call.countOperandBundlesOfType(LLVMContext::OB_deopt) == 1,
5080 Assert(isa<CallInst>(Call), "experimental_deoptimize cannot be invoked",
5082 Assert(Call.countOperandBundlesOfType(LLVMContext::OB_deopt) == 1,
5085 Assert(Call.getType() == Call.getFunction()->getReturnType(),
5090 Assert(RI,
5094 Assert(RI->getReturnValue() == &Call,
5111 Assert(ArgTy->isIntOrIntVectorTy() && ArgTy->isVectorTy(),
5118 Assert(ArgTy->isFPOrFPVectorTy() && ArgTy->isVectorTy(),
5127 Assert(ArgTy->isFPOrFPVectorTy() && ArgTy->isVectorTy(),
5141 Assert(Op1->getType()->isIntOrIntVectorTy(),
5144 Assert(Op2->getType()->isIntOrIntVectorTy(),
5149 Assert(Op3->getType()->getBitWidth() <= 32,
5154 Assert(
5159 Assert(Op3->getZExtValue() <= Op1->getType()->getScalarSizeInBits(),
5171 Assert(!ValTy->isVectorTy() && !ResultTy->isVectorTy(),
5178 Assert(Size % 16 == 0, "bswap must be an even number of bytes", &Call);
5183 Assert(InvariantSize &&
5239 Assert(ResultTy->getElementType()->isIntegerTy() ||
5243 Assert(ResultTy->getElementType() == Op0ElemTy,
5248 Assert(ResultTy->getElementType() == Op1ElemTy,
5252 Assert(cast<FixedVectorType>(ResultTy)->getNumElements() ==
5257 Assert(Stride->getZExtValue() >= NumRows->getZExtValue(),
5264 Assert(VecTy && VecTy->getScalarType()->isIntegerTy() &&
5275 Assert(VecTy->getElementType() == SubVecTy->getElementType(),
5285 Assert(ResultTy->getElementType() == VecTy->getElementType(),
5334 Assert((FPI.getNumArgOperands() == NumOperands),
5342 Assert(!ValTy->isVectorTy() && !ResultTy->isVectorTy(),
5351 Assert(!ValTy->isVectorTy() && !ResultTy->isVectorTy(),
5359 Assert(CmpInst::isFPPredicate(Pred),
5368 Assert(Operand->getType()->isFPOrFPVectorTy(),
5375 Assert((NumSrcElem > 0) == Operand->getType()->isVectorTy(),
5377 Assert(Operand->getType()->isIntOrIntVectorTy(),
5380 Assert(NumSrcElem == cast<FixedVectorType>(OperandT)->getNumElements(),
5391 Assert(Operand->getType()->isIntOrIntVectorTy(),
5398 Assert((NumSrcElem > 0) == Operand->getType()->isVectorTy(),
5400 Assert(Operand->getType()->isFPOrFPVectorTy(),
5403 Assert(NumSrcElem == cast<FixedVectorType>(OperandT)->getNumElements(),
5415 Assert(OperandTy->isFPOrFPVectorTy(),
5417 Assert(ResultTy->isFPOrFPVectorTy(),
5419 Assert(OperandTy->isVectorTy() == ResultTy->isVectorTy(),
5422 Assert(cast<FixedVectorType>(OperandTy)->getNumElements() ==
5428 Assert(OperandTy->getScalarSizeInBits() > ResultTy->getScalarSizeInBits(),
5432 Assert(OperandTy->getScalarSizeInBits() < ResultTy->getScalarSizeInBits(),
5448 Assert(FPI.getExceptionBehavior().hasValue(),
5451 Assert(FPI.getRoundingMode().hasValue(),
5514 Assert(Loc, "llvm.dbg." + Kind + " intrinsic requires a !dbg attachment",
5630 Assert(First->getCallingConv() == F->getCallingConv(),
5655 Assert(ScopeListMV != nullptr,
5661 Assert(ScopeListMD != nullptr, "!id.scope.list must point to an MDNode",
5663 Assert(ScopeListMD->getNumOperands() == 1,
5706 Assert(!DT.dominates(I, J),
5992 // to Assert that.