Lines Matching refs:Check

666 #define Check(C, ...)                                                          \
712 Check(I.getOperand(i) != nullptr, "Operand is null", &I);
735 Check(!GV.isDeclaration() || GV.hasValidDeclarationLinkage(),
741 Check(A->value() <= Value::MaximumAlignment,
747 Check(Associated->getNumOperands() == 1,
750 Check(Op, "associated metadata must have a global value", GO, Associated);
753 Check(VM, "associated metadata must be ValueAsMetadata", GO, Associated);
755 Check(isa<PointerType>(VM->getValue()->getType()),
759 Check(isa<GlobalObject>(Stripped) || isa<Constant>(Stripped),
761 Check(Stripped != GO,
776 Check(!GV.hasAppendingLinkage() || isa<GlobalVariable>(GV),
781 Check(GVar && GVar->getValueType()->isArrayTy(),
786 Check(!GV.hasComdat(), "Declaration may not be in a Comdat!", &GV);
789 Check(!GV.hasHiddenVisibility(),
794 Check(GV.hasDefaultVisibility(),
796 Check(!GV.isDSOLocal(), "GlobalValue with DLLImport Storage is dso_local!",
799 Check((GV.isDeclaration() &&
806 Check(GV.isDSOLocal(),
812 Check(!GV.hasSection(), "tagged GlobalValue must not be in section.", &GV);
839 Check(GV.getInitializer()->getType() == GVType,
846 Check(GV.getInitializer()->isNullValue(),
848 Check(!GV.isConstant(), "'common' global may not be marked constant!",
850 Check(!GV.hasComdat(), "'common' global may not be in a Comdat!", &GV);
856 Check(!GV.hasInitializer() || GV.hasAppendingLinkage(),
858 Check(GV.materialized_use_empty(),
867 Check(STy && (STy->getNumElements() == 2 || STy->getNumElements() == 3) &&
871 Check(STy->getNumElements() == 3,
875 Check(ETy->isPointerTy(), "wrong type for intrinsic global variable",
882 Check(!GV.hasInitializer() || GV.hasAppendingLinkage(),
884 Check(GV.materialized_use_empty(),
889 Check(PTy, "wrong type for intrinsic global variable", &GV);
893 Check(InitArray, "wrong initalizer for intrinsic global variable",
897 Check(isa<GlobalVariable>(V) || isa<Function>(V) ||
900 Check(V->hasName(),
920 Check(!GVType->isScalableTy(), "Globals cannot contain scalable types", &GV);
922 // Check if it is or contains a target extension type that disallows being
924 Check(!GVType->containsNonGlobalTargetExtType(),
948 Check(isa<GlobalValue>(C) &&
956 Check(!GV->isDeclarationForLinker(), "Alias must point to a definition",
961 Check(Visited.insert(GA2).second, "Aliases cannot form a cycle", &GA);
963 Check(!GA2->isInterposable(),
985 Check(GlobalAlias::isValidLinkage(GA.getLinkage()),
990 Check(Aliasee, "Aliasee cannot be NULL!", &GA);
991 Check(GA.getType() == Aliasee->getType(),
994 Check(isa<GlobalValue>(Aliasee) || isa<ConstantExpr>(Aliasee),
1003 Check(GlobalIFunc::isValidLinkage(GI.getLinkage()),
1010 Check(Resolver, "IFunc must have a Function resolver", &GI);
1011 Check(!Resolver->isDeclarationForLinker(),
1014 // Check that the immediate resolver operand (prior to any bitcasts) has the
1018 Check(isa<PointerType>(Resolver->getFunctionType()->getReturnType()),
1021 Check(ResolverTy == PointerType::get(Context, GI.getAddressSpace()),
1048 Check(&MD.getContext() == &Context,
1066 Check(!isa<LocalAsMetadata>(Op), "Invalid operand for global metadata!",
1080 // Check these last, so we diagnose problems in operands first.
1081 Check(!MD.isTemporary(), "Expected no forward declarations!", &MD);
1082 Check(MD.isResolved(), "All nodes should be resolved!", &MD);
1086 Check(MD.getValue(), "Expected valid value", &MD);
1087 Check(!MD.getValue()->getType()->isMetadataTy(),
1094 Check(F, "function-local metadata used outside a function", L);
1100 Check(I->getParent(), "function-local metadata not in basic block", L, I);
1108 Check(ActualF == F, "function-local metadata used in wrong function", L);
1616 // Check only if the global variable is not an extern
1692 Check(!GV->hasPrivateLinkage(), "comdat global value has private linkage",
1704 Check(N->getNumOperands() == 1,
1706 Check(dyn_cast_or_null<MDString>(N->getOperand(0)),
1722 Check(N->getNumOperands() == 1,
1724 Check(dyn_cast_or_null<MDString>(N->getOperand(0)),
1788 Check(Op->getNumOperands() == 3,
1792 Check(mdconst::dyn_extract_or_null<ConstantInt>(Op->getOperand(0)),
1795 Check(false,
1800 Check(ID, "invalid ID operand in module flag (expected metadata string)",
1803 // Check the values for behaviors with additional requirements.
1813 Check(V && V->getValue().isNonNegative(),
1821 Check(mdconst::dyn_extract_or_null<ConstantInt>(Op->getOperand(2)),
1831 Check(Value && Value->getNumOperands() == 2,
1834 Check(isa<MDString>(Value->getOperand(0)),
1848 Check(isa<MDNode>(Op->getOperand(2)),
1859 Check(Inserted,
1866 Check(Value, "wchar_size metadata requires constant integer argument");
1873 Check(M.getNamedMetadata("llvm.linker.options"),
1880 Check(Value,
1895 Check(F && isa<Function>(F->getValue()->stripPointerCasts()),
1899 Check(Node && Node->getNumOperands() == 3, "expected a MDNode triple", MDO);
1903 Check(Count && Count->getType()->isIntegerTy(),
1933 // VerifyParameterAttrs - Check the given attributes for an argument or return
1943 Check(Attr.isStringAttribute() ||
1949 Check(Attrs.getNumAttributes() == 1,
1953 // Check for mutually incompatible attributes. Only inreg is compatible with
1963 Check(AttrCount <= 1,
1968 Check(!(Attrs.hasAttribute(Attribute::InAlloca) &&
1974 Check(!(Attrs.hasAttribute(Attribute::StructRet) &&
1980 Check(!(Attrs.hasAttribute(Attribute::ZExt) &&
1986 Check(!(Attrs.hasAttribute(Attribute::ReadNone) &&
1992 Check(!(Attrs.hasAttribute(Attribute::ReadNone) &&
1998 Check(!(Attrs.hasAttribute(Attribute::ReadOnly) &&
2004 Check(!(Attrs.hasAttribute(Attribute::NoInline) &&
2010 Check(!(Attrs.hasAttribute(Attribute::Writable) &&
2014 Check(!(Attrs.hasAttribute(Attribute::Writable) &&
2031 Check(AttrAlign.value() <= Value::MaximumAlignment,
2037 Check(ByValTy->isSized(&Visited),
2039 // Check if it is or contains a target extension type that disallows being
2041 Check(!ByValTy->containsNonLocalTargetExtType(),
2043 Check(DL.getTypeAllocSize(ByValTy).getKnownMinValue() < (1ULL << 32),
2048 Check(Attrs.getByRefType()->isSized(&Visited),
2050 Check(DL.getTypeAllocSize(Attrs.getByRefType()).getKnownMinValue() <
2056 Check(Attrs.getInAllocaType()->isSized(&Visited),
2058 Check(DL.getTypeAllocSize(Attrs.getInAllocaType()).getKnownMinValue() <
2064 Check(Attrs.getPreallocatedType()->isSized(&Visited),
2066 Check(
2075 Check(!Inits.empty(), "Attribute 'initializes' does not support empty list",
2077 Check(ConstantRangeList::isOrderedRanges(Inits),
2083 Check(Val != 0, "Attribute 'nofpclass' must have at least one test bit set",
2085 Check((Val & ~static_cast<unsigned>(fcAllFlags)) == 0,
2091 Check(Ty->isIntOrIntVectorTy(CR.getBitWidth()),
2106 // Check parameter attributes against a function type.
2115 Check(Attrs.hasParentContext(Context),
2118 Check(!AttrSet.hasAttributes() || AttrSet.hasParentContext(Context),
2121 Check(A.hasParentContext(Context),
2137 Check(RetAttr.isStringAttribute() ||
2162 Check(!ArgAttrs.hasAttribute(Attribute::ImmArg),
2165 Check(!ArgAttrs.hasAttribute(Attribute::ElementType),
2175 Check(!SawNest, "More than one parameter has attribute nest!", V);
2180 Check(!SawReturned, "More than one parameter has attribute returned!", V);
2181 Check(Ty->canLosslesslyBitCastTo(FT->getReturnType()),
2188 Check(!SawSRet, "Cannot have multiple 'sret' parameters!", V);
2189 Check(i == 0 || i == 1,
2195 Check(!SawSwiftSelf, "Cannot have multiple 'swiftself' parameters!", V);
2200 Check(!SawSwiftAsync, "Cannot have multiple 'swiftasync' parameters!", V);
2205 Check(!SawSwiftError, "Cannot have multiple 'swifterror' parameters!", V);
2210 Check(i == FT->getNumParams() - 1,
2220 Check(FnAttr.isStringAttribute() ||
2226 Check(!(Attrs.hasFnAttr(Attribute::NoInline) &&
2231 Check(Attrs.hasFnAttr(Attribute::NoInline),
2234 Check(!Attrs.hasFnAttr(Attribute::OptimizeForSize),
2237 Check(!Attrs.hasFnAttr(Attribute::MinSize),
2240 Check(!Attrs.hasFnAttr(Attribute::OptimizeForDebugging),
2244 Check(!(Attrs.hasFnAttr(Attribute::SanitizeRealtime) &&
2251 Check(!Attrs.hasFnAttr(Attribute::OptimizeForSize),
2254 Check(!Attrs.hasFnAttr(Attribute::MinSize),
2258 Check(!Attrs.hasAttrSomewhere(Attribute::Writable) ||
2264 Check(!Attrs.hasFnAttr("aarch64_pstate_sm_compatible"),
2270 Check((Attrs.hasFnAttr("aarch64_new_za") + Attrs.hasFnAttr("aarch64_in_za") +
2280 Check((Attrs.hasFnAttr("aarch64_new_zt0") +
2293 Check(GV->hasGlobalUnnamedAddr(),
2359 // Check EVEX512 feature.
2363 Check(!TF.contains("+avx512f") || !TF.contains("-evex512"),
2435 Check(MD->getNumOperands() >= 2,
2438 // Check first operand.
2439 Check(MD->getOperand(0) != nullptr, "first operand should not be null",
2441 Check(isa<MDString>(MD->getOperand(0)),
2445 Check(ProfName == "function_entry_count" ||
2451 // Check second operand.
2452 Check(MD->getOperand(1) != nullptr, "second operand should not be null",
2454 Check(isa<ConstantAsMetadata>(MD->getOperand(1)),
2458 Check(MD->getNumOperands() == 1,
2460 Check(MD->getOperand(0) != nullptr, "!kcfi_type operand must not be null",
2462 Check(isa<ConstantAsMetadata>(MD->getOperand(0)),
2465 Check(isa<ConstantInt>(C) && isa<IntegerType>(C->getType()),
2467 Check(cast<ConstantInt>(C)->getBitWidth() == 32,
2483 // Check this constant expression.
2493 Check(GV->getParent() == &M, "Referencing global in another module!",
2512 Check(CastInst::castIsValid(Instruction::BitCast, CE->getOperand(0),
2518 Check(CPA->getPointer()->getType()->isPointerTy(),
2521 Check(CPA->getType() == CPA->getPointer()->getType(),
2524 Check(CPA->getKey()->getBitWidth() == 32,
2527 Check(CPA->getAddrDiscriminator()->getType()->isPointerTy(),
2530 Check(CPA->getDiscriminator()->getBitWidth() == 64,
2556 Check(Arg->getType()->isPointerTy(),
2559 Check(Call.getParamElementType(ArgNo),
2563 Check(!Call.paramHasAttr(ArgNo, Attribute::ElementType),
2573 Check(LabelNo == CallBr->getNumIndirectDests(),
2577 Check(LabelNo == 0, "Label constraints can only be used with callbr",
2588 Check(!Call.doesNotAccessMemory() && !Call.onlyReadsMemory() &&
2597 Check(NumPatchBytes >= 0,
2603 Check(TargetElemType,
2606 Check(TargetFuncType,
2610 Check(NumCallArgs >= 0,
2616 Check(NumCallArgs >= NumParams,
2620 Check(TargetFuncType->getReturnType()->isVoidTy(),
2625 Check(NumCallArgs == NumParams,
2630 Check((Flags & ~(uint64_t)StatepointFlags::MaskAll) == 0,
2639 Check(ArgType == ParamType,
2646 Check(!ArgAttrs.hasAttribute(Attribute::StructRet),
2654 Check(isa<ConstantInt>(NumTransitionArgsV),
2660 Check(NumTransitionArgs == 0,
2665 Check(isa<ConstantInt>(NumDeoptArgsV),
2670 Check(NumDeoptArgs == 0,
2674 Check(ExpectedNumArgs == (int)Call.arg_size(),
2677 // Check that the only uses of this gc.statepoint are gc.result or
2682 Check(UserCall, "illegal use of statepoint token", Call, U);
2685 Check(isa<GCRelocateInst>(UserCall) || isa<GCResultInst>(UserCall),
2690 Check(UserCall->getArgOperand(0) == &Call,
2693 Check(UserCall->getArgOperand(0) == &Call,
2713 Check(MaxRecoveredIndex <= EscapedObjectCount,
2754 Check(false, "EH pads can't handle each other's exceptions",
2779 // Check function arguments.
2783 Check(&Context == &F.getContext(),
2786 Check(!F.hasCommonLinkage(), "Functions may not have common linkage", &F);
2787 Check(FT->getNumParams() == NumArgs,
2790 Check(F.getReturnType()->isFirstClassType() ||
2794 Check(!F.hasStructRetAttr() || F.getReturnType()->isVoidTy(),
2799 Check(verifyAttributeCount(Attrs, FT->getNumParams()),
2809 // Check function attributes.
2815 Check(!Attrs.hasFnAttr(Attribute::Builtin),
2818 Check(!Attrs.hasAttrSomewhere(Attribute::ElementType),
2823 Check(Arg.use_empty(), "cannot use argument of naked function", &Arg);
2825 // Check that this function meets the restrictions on this calling convention.
2833 Check(F.arg_empty() || Attrs.hasParamAttr(0, Attribute::ByVal),
2841 Check(F.getReturnType()->isVoidTy(),
2849 Check(!F.hasStructRetAttr(), "Calling convention does not allow sret", &F);
2854 Check(!Attrs.hasParamAttr(i, Attribute::ByVal),
2856 Check(!Attrs.hasParamAttr(i, Attribute::Preallocated),
2858 Check(!Attrs.hasParamAttr(i, Attribute::InAlloca),
2864 Check(Arg.getType()->getPointerAddressSpace() != StackAS,
2878 Check(!F.isVarArg(),
2885 // Check that the argument values match the function type for this function...
2888 Check(Arg.getType() == FT->getParamType(i),
2891 Check(Arg.getType()->isFirstClassType(),
2894 Check(!Arg.getType()->isMetadataTy(),
2896 Check(!Arg.getType()->isTokenTy(),
2898 Check(!Arg.getType()->isX86_AMXTy(),
2902 // Check that swifterror argument is only used by loads and stores.
2910 Check(!F.getReturnType()->isTokenTy(),
2912 Check(!F.getReturnType()->isX86_AMXTy(),
2922 // Check validity of the personality function
2926 Check(Per->getParent() == F.getParent(),
2936 Check(MDs.empty(), "unmaterialized function cannot have metadata", &F,
2945 Check(I.first != LLVMContext::MD_prof,
2951 Check(!F.hasPersonalityFn(),
2956 Check(!IsIntrinsic, "llvm intrinsics cannot be defined!", &F);
2958 // Check the entry node
2960 Check(pred_empty(Entry),
2965 Check(!BlockAddress::lookup(Entry)->isConstantUsed(),
2998 Check(NumProfAttachments == 1,
3003 Check(NumKCFIAttachments == 1,
3022 Check(false, "Invalid user of intrinsic instruction!", U);
3025 // Check intrinsics' signatures.
3029 Check(FT->getNumParams() == 1, "wrong number of parameters", F);
3030 Check(isa<PointerType>(F.getReturnType()),
3032 Check(FT->getParamType(0) == F.getReturnType(),
3038 Check(FT->getNumParams() == 1, "wrong number of parameters", F);
3039 Check(isa<PointerType>(FT->getParamType(0)),
3041 Check(F.getReturnType()->isIntegerTy(),
3052 // Check that all !dbg attachments lead to back to N.
3054 // FIXME: Check this incrementally while visiting !dbg attachments.
3071 Check(Scope, "Failed to find DILocalScope", DL);
3106 Check(BB.getTerminator(), "Basic Block does not have terminator!", &BB);
3108 // Check constraints that this basic block imposes on all of the PHI nodes in
3115 Check(PN.getNumIncomingValues() == Preds.size(),
3129 // Check to make sure that if there is more than one entry for a
3133 Check(i == 0 || Values[i].first != Values[i - 1].first ||
3139 // Check to make sure that the predecessors and PHI node entries are
3141 Check(Values[i].first == Preds[i],
3148 // Check that all instructions have their parent pointers set up correctly.
3151 Check(I.getParent() == &BB, "Instruction has bogus parent pointer!");
3167 Check(&I == I.getParent()->getTerminator(),
3174 Check(BI.getCondition()->getType()->isIntegerTy(1),
3184 Check(N == 0,
3189 Check(N == 1 && F->getReturnType() == RI.getOperand(0)->getType(),
3194 // Check to make sure that the return value has necessary properties for
3200 Check(SI.getType()->isVoidTy(), "Switch must have void result type!", &SI);
3201 // Check to make sure that all of the constants in the switch instruction
3206 Check(isa<ConstantInt>(SI.getOperand(Case.getCaseIndex() * 2 + 2)),
3208 Check(Case.getCaseValue()->getType() == SwitchTy,
3210 Check(Constants.insert(Case.getCaseValue()).second,
3218 Check(BI.getAddress()->getType()->isPointerTy(),
3221 Check(BI.getDestination(i)->getType()->isLabelTy(),
3228 Check(CBI.isInlineAsm(), "Callbr is currently only used for asm-goto!", &CBI);
3230 Check(!IA->canThrow(), "Unwinding from Callbr is not allowed");
3237 Check(!SelectInst::areInvalidOperands(SI.getOperand(0), SI.getOperand(1),
3241 Check(SI.getTrueValue()->getType() == SI.getType(),
3250 Check(false, "User-defined operators should not live outside of a pass!", &I);
3262 Check(SrcTy->isIntOrIntVectorTy(), "Trunc only operates on integer", &I);
3263 Check(DestTy->isIntOrIntVectorTy(), "Trunc only produces integer", &I);
3264 Check(SrcTy->isVectorTy() == DestTy->isVectorTy(),
3266 Check(SrcBitSize > DestBitSize, "DestTy too big for Trunc", &I);
3277 Check(SrcTy->isIntOrIntVectorTy(), "ZExt only operates on integer", &I);
3278 Check(DestTy->isIntOrIntVectorTy(), "ZExt only produces an integer", &I);
3279 Check(SrcTy->isVectorTy() == DestTy->isVectorTy(),
3284 Check(SrcBitSize < DestBitSize, "Type too small for ZExt", &I);
3298 Check(SrcTy->isIntOrIntVectorTy(), "SExt only operates on integer", &I);
3299 Check(DestTy->isIntOrIntVectorTy(), "SExt only produces an integer", &I);
3300 Check(SrcTy->isVectorTy() == DestTy->isVectorTy(),
3302 Check(SrcBitSize < DestBitSize, "Type too small for SExt", &I);
3315 Check(SrcTy->isFPOrFPVectorTy(), "FPTrunc only operates on FP", &I);
3316 Check(DestTy->isFPOrFPVectorTy(), "FPTrunc only produces an FP", &I);
3317 Check(SrcTy->isVectorTy() == DestTy->isVectorTy(),
3319 Check(SrcBitSize > DestBitSize, "DestTy too big for FPTrunc", &I);
3333 Check(SrcTy->isFPOrFPVectorTy(), "FPExt only operates on FP", &I);
3334 Check(DestTy->isFPOrFPVectorTy(), "FPExt only produces an FP", &I);
3335 Check(SrcTy->isVectorTy() == DestTy->isVectorTy(),
3337 Check(SrcBitSize < DestBitSize, "DestTy too small for FPExt", &I);
3350 Check(SrcVec == DstVec,
3352 Check(SrcTy->isIntOrIntVectorTy(),
3354 Check(DestTy->isFPOrFPVectorTy(), "UIToFP result must be FP or FP vector",
3358 Check(cast<VectorType>(SrcTy)->getElementCount() ==
3373 Check(SrcVec == DstVec,
3375 Check(SrcTy->isIntOrIntVectorTy(),
3377 Check(DestTy->isFPOrFPVectorTy(), "SIToFP result must be FP or FP vector",
3381 Check(cast<VectorType>(SrcTy)->getElementCount() ==
3396 Check(SrcVec == DstVec,
3398 Check(SrcTy->isFPOrFPVectorTy(), "FPToUI source must be FP or FP vector", &I);
3399 Check(DestTy->isIntOrIntVectorTy(),
3403 Check(cast<VectorType>(SrcTy)->getElementCount() ==
3418 Check(SrcVec == DstVec,
3420 Check(SrcTy->isFPOrFPVectorTy(), "FPToSI source must be FP or FP vector", &I);
3421 Check(DestTy->isIntOrIntVectorTy(),
3425 Check(cast<VectorType>(SrcTy)->getElementCount() ==
3437 Check(SrcTy->isPtrOrPtrVectorTy(), "PtrToInt source must be pointer", &I);
3439 Check(DestTy->isIntOrIntVectorTy(), "PtrToInt result must be integral", &I);
3440 Check(SrcTy->isVectorTy() == DestTy->isVectorTy(), "PtrToInt type mismatch",
3446 Check(VSrc->getElementCount() == VDest->getElementCount(),
3458 Check(SrcTy->isIntOrIntVectorTy(), "IntToPtr source must be an integral", &I);
3459 Check(DestTy->isPtrOrPtrVectorTy(), "IntToPtr result must be a pointer", &I);
3461 Check(SrcTy->isVectorTy() == DestTy->isVectorTy(), "IntToPtr type mismatch",
3466 Check(VSrc->getElementCount() == VDest->getElementCount(),
3473 Check(
3483 Check(SrcTy->isPtrOrPtrVectorTy(), "AddrSpaceCast source must be a pointer",
3485 Check(DestTy->isPtrOrPtrVectorTy(), "AddrSpaceCast result must be a pointer",
3487 Check(SrcTy->getPointerAddressSpace() != DestTy->getPointerAddressSpace(),
3490 Check(SrcVTy->getElementCount() ==
3503 Check(&PN == &PN.getParent()->front() ||
3507 // Check that a PHI doesn't yield a Token.
3508 Check(!PN.getType()->isTokenTy(), "PHI nodes cannot have token type!");
3510 // Check that all of the values of the PHI node have the same type as the
3513 Check(PN.getType() == IncValue->getType(),
3523 Check(Call.getCalledOperand()->getType()->isPointerTy(),
3529 Check(Call.arg_size() >= FTy->getNumParams(),
3532 Check(Call.arg_size() == FTy->getNumParams(),
3537 Check(Call.getArgOperand(i)->getType() == FTy->getParamType(i),
3543 Check(verifyAttributeCount(Attrs, Call.arg_size()),
3550 Check(Callee->getValueType() == FTy,
3556 Check(CC != CallingConv::AMDGPU_CS_Chain &&
3570 Check(ABIAlign.value() <= Value::MaximumAlignment,
3585 Check(Callee && Callee->isSpeculatable(),
3590 Check(Call.getCalledFunction()->getIntrinsicID() ==
3605 Check(AI->isUsedWithInAlloca(),
3616 Check(AI->isSwiftError(),
3621 Check(ArgI, "swifterror argument should come from an alloca or parameter",
3623 Check(ArgI->hasSwiftErrorAttr(),
3631 Check(Callee && Callee->hasParamAttribute(i, Attribute::ImmArg),
3638 Check(isa<ConstantInt>(ArgVal) || isa<ConstantFP>(ArgVal),
3647 Check(hasOB != isMustTail,
3666 // Check attributes on the varargs part.
3673 Check(!SawNest, "More than one parameter has attribute nest!", Call);
3678 Check(!SawReturned, "More than one parameter has attribute returned!",
3680 Check(Ty->canLosslesslyBitCastTo(FTy->getReturnType()),
3692 Check(!ArgAttrs.hasAttribute(Attribute::StructRet),
3697 Check(Idx == Call.arg_size() - 1,
3705 Check(!ParamTy->isMetadataTy(),
3707 Check(!ParamTy->isTokenTy(),
3714 Check(!FTy->getReturnType()->isTokenTy(),
3716 Check(!FTy->getReturnType()->isX86_AMXTy(),
3736 Check(!FoundDeoptBundle, "Multiple deopt operand bundles", Call);
3739 Check(!FoundGCTransitionBundle, "Multiple gc-transition operand bundles",
3743 Check(!FoundFuncletBundle, "Multiple funclet operand bundles", Call);
3745 Check(BU.Inputs.size() == 1,
3747 Check(isa<FuncletPadInst>(BU.Inputs.front()),
3751 Check(!FoundCFGuardTargetBundle, "Multiple CFGuardTarget operand bundles",
3754 Check(BU.Inputs.size() == 1,
3757 Check(!FoundPtrauthBundle, "Multiple ptrauth operand bundles", Call);
3759 Check(BU.Inputs.size() == 2,
3761 Check(isa<ConstantInt>(BU.Inputs[0]) &&
3764 Check(BU.Inputs[1]->getType()->isIntegerTy(64),
3767 Check(!FoundKCFIBundle, "Multiple kcfi operand bundles", Call);
3769 Check(BU.Inputs.size() == 1, "Expected exactly one kcfi bundle operand",
3771 Check(isa<ConstantInt>(BU.Inputs[0]) &&
3775 Check(!FoundPreallocatedBundle, "Multiple preallocated operand bundles",
3778 Check(BU.Inputs.size() == 1,
3781 Check(Input &&
3787 Check(!FoundGCLiveBundle, "Multiple gc-live operand bundles", Call);
3790 Check(!FoundAttachedCallBundle,
3798 Check(!(Call.getCalledFunction() && FoundPtrauthBundle),
3825 Check(!Attrs.contains(Attribute::InAlloca),
3827 Check(!Attrs.contains(Attribute::InReg),
3829 Check(!Attrs.contains(Attribute::SwiftError),
3831 Check(!Attrs.contains(Attribute::Preallocated),
3833 Check(!Attrs.contains(Attribute::ByRef),
3871 Check(!CI.isInlineAsm(), "cannot use musttail call with inline asm", &CI);
3876 Check(CallerTy->isVarArg() == CalleeTy->isVarArg(),
3878 Check(isTypeCongruent(CallerTy->getReturnType(), CalleeTy->getReturnType()),
3882 Check(F->getCallingConv() == CI.getCallingConv(),
3894 Check(BI->getOperand(0) == RetVal,
3900 // Check the return.
3902 Check(Ret, "musttail call must precede a ret with an optional bitcast", &CI);
3903 Check(!Ret->getReturnValue() || Ret->getReturnValue() == RetVal ||
3927 Check(!CallerTy->isVarArg(), Twine("cannot guarantee ") + CCName +
3936 Check(CallerTy->getNumParams() == CalleeTy->getNumParams(),
3939 Check(
3950 Check(CallerABIAttrs == CalleeABIAttrs,
3969 Check(
3977 /// visitUnaryOperator - Check the argument to the unary operator.
3980 Check(U.getType() == U.getOperand(0)->getType(),
3986 // Check that floating-point arithmetic operators are only used with
3989 Check(U.getType()->isFPOrFPVectorTy(),
3999 /// visitBinaryOperator - Check that both arguments to the binary operator are
4003 Check(B.getOperand(0)->getType() == B.getOperand(1)->getType(),
4007 // Check that integer arithmetic operators are only used with
4016 Check(B.getType()->isIntOrIntVectorTy(),
4018 Check(B.getType() == B.getOperand(0)->getType(),
4023 // Check that floating-point arithmetic operators are only used with
4030 Check(B.getType()->isFPOrFPVectorTy(),
4034 Check(B.getType() == B.getOperand(0)->getType(),
4039 // Check that logical operators are only used with integral operands.
4043 Check(B.getType()->isIntOrIntVectorTy(),
4045 Check(B.getType() == B.getOperand(0)->getType(),
4051 Check(B.getType()->isIntOrIntVectorTy(),
4053 Check(B.getType() == B.getOperand(0)->getType(),
4064 // Check that the operands are the same type
4067 Check(Op0Ty == Op1Ty,
4069 // Check that the operands are the right type
4070 Check(Op0Ty->isIntOrIntVectorTy() || Op0Ty->isPtrOrPtrVectorTy(),
4072 // Check that the predicate is valid.
4073 Check(IC.isIntPredicate(), "Invalid predicate in ICmp instruction!", &IC);
4079 // Check that the operands are the same type
4082 Check(Op0Ty == Op1Ty,
4084 // Check that the operands are the right type
4085 Check(Op0Ty->isFPOrFPVectorTy(), "Invalid operand types for FCmp instruction",
4087 // Check that the predicate is valid.
4088 Check(FC.isFPPredicate(), "Invalid predicate in FCmp instruction!", &FC);
4094 Check(ExtractElementInst::isValidOperands(EI.getOperand(0), EI.getOperand(1)),
4100 Check(InsertElementInst::isValidOperands(IE.getOperand(0), IE.getOperand(1),
4107 Check(ShuffleVectorInst::isValidOperands(SV.getOperand(0), SV.getOperand(1),
4116 Check(isa<PointerType>(TargetTy),
4118 Check(GEP.getSourceElementType()->isSized(), "GEP into unsized type!", &GEP);
4121 Check(!STy->isScalableTy(),
4128 Check(
4133 Check(ElTy, "Invalid indices for GEP pointer type!", &GEP);
4137 Check(PtrTy && GEP.getResultElementType() == ElTy,
4144 Check(
4152 Check(IndexWidth == GEPWidth, "Invalid GEP index vector width", &GEP);
4154 Check(IndexTy->isIntOrIntVectorTy(),
4159 Check(GEP.getAddressSpace() == PtrTy->getAddressSpace(),
4174 Check(NumOperands % 2 == 0, "Unfinished range!", Range);
4176 Check(NumRanges >= 1, "It should have at least one range!", Range);
4182 Check(Low, "The lower limit must be an integer!", Low);
4185 Check(High, "The upper limit must be an integer!", High);
4187 Check(High->getType() == Low->getType(), "Range pair types must match!",
4191 Check(High->getType()->isIntegerTy(32),
4194 Check(High->getType() == Ty->getScalarType(),
4203 Check(LowV != HighV || LowV.isMaxValue() || LowV.isMinValue(),
4207 Check(!CurRange.isEmptySet() &&
4212 Check(CurRange.intersectWith(LastRange).isEmptySet(),
4214 Check(LowV.sgt(LastRange.getLower()), "Intervals are not in order",
4216 Check(!isContiguous(CurRange, LastRange), "Intervals are contiguous",
4227 Check(FirstRange.intersectWith(LastRange).isEmptySet(),
4229 Check(!isContiguous(FirstRange, LastRange), "Intervals are contiguous",
4250 Check(Size >= 8, "atomic memory access' size must be byte-sized", Ty, I);
4251 Check(!(Size & (Size - 1)),
4257 Check(PTy, "Load operand must be a pointer.", &LI);
4260 Check(A->value() <= Value::MaximumAlignment,
4263 Check(ElTy->isSized(), "loading unsized types is not allowed", &LI);
4265 Check(LI.getOrdering() != AtomicOrdering::Release &&
4268 Check(ElTy->isIntOrPtrTy() || ElTy->isFloatingPointTy(),
4274 Check(LI.getSyncScopeID() == SyncScope::System,
4283 Check(PTy, "Store operand must be a pointer.", &SI);
4286 Check(A->value() <= Value::MaximumAlignment,
4289 Check(ElTy->isSized(), "storing unsized types is not allowed", &SI);
4291 Check(SI.getOrdering() != AtomicOrdering::Acquire &&
4294 Check(ElTy->isIntOrPtrTy() || ElTy->isFloatingPointTy(),
4300 Check(SI.getSyncScopeID() == SyncScope::System,
4306 /// Check that SwiftErrorVal is used as a swifterror argument in CS.
4311 Check(Call.paramHasAttr(I.index(), Attribute::SwiftError),
4320 // Check that swifterror value is only used by loads, stores, or as
4323 Check(isa<LoadInst>(U) || isa<StoreInst>(U) || isa<CallInst>(U) ||
4330 Check(StoreI->getOperand(1) == SwiftErrorVal,
4342 Check(Ty->isSized(&Visited), "Cannot allocate unsized type", &AI);
4343 // Check if it's a target extension type that disallows being used on the
4345 Check(!Ty->containsNonLocalTargetExtType(),
4347 Check(AI.getArraySize()->getType()->isIntegerTy(),
4350 Check(A->value() <= Value::MaximumAlignment,
4355 Check(Ty->isPointerTy(), "swifterror alloca must have pointer type", &AI);
4356 Check(!AI.isArrayAllocation(),
4366 Check(ElTy->isIntOrPtrTy(),
4373 Check(RMWI.getOrdering() != AtomicOrdering::Unordered,
4378 Check(ElTy->isIntegerTy() || ElTy->isFloatingPointTy() ||
4384 Check(ElTy->isFPOrFPVectorTy() && !isa<ScalableVectorType>(ElTy),
4390 Check(ElTy->isIntegerTy(),
4396 Check(AtomicRMWInst::FIRST_BINOP <= Op && Op <= AtomicRMWInst::LAST_BINOP,
4403 Check(Ordering == AtomicOrdering::Acquire ||
4414 Check(ExtractValueInst::getIndexedType(EVI.getAggregateOperand()->getType(),
4422 Check(ExtractValueInst::getIndexedType(IVI.getAggregateOperand()->getType(),
4443 Check(BB != &F->getEntryBlock(), "EH pad cannot be in entry block.", &I);
4451 Check(II && II->getUnwindDest() == BB && II->getNormalDest() != BB,
4460 Check(BB->getUniquePredecessor() == CPI->getCatchSwitch()->getParent(),
4464 Check(BB != CPI->getCatchSwitch()->getUnwindDest(),
4478 Check(II->getUnwindDest() == BB && II->getNormalDest() != BB,
4491 Check(FromPad != ToPadParent, "A cleanupret must exit its cleanup", CRI);
4495 Check(false, "EH pad must be jumped to via an unwind edge", ToPad, TI);
4501 Check(FromPad != ToPad,
4507 Check(!isa<ConstantTokenNone>(FromPad),
4509 Check(Seen.insert(FromPad).second, "EH pad jumps through a cycle of pads",
4514 Check(isa<FuncletPadInst>(FromPad) || isa<CatchSwitchInst>(FromPad),
4523 Check(LPI.getNumClauses() > 0 || LPI.isCleanup(),
4531 Check(LandingPadResultTy == LPI.getType(),
4537 Check(F->hasPersonalityFn(),
4542 Check(LPI.getParent()->getLandingPadInst() == &LPI,
4548 Check(isa<PointerType>(Clause->getType()),
4551 Check(LPI.isFilter(i), "Clause is neither catch nor filter!", &LPI);
4552 Check(isa<ConstantArray>(Clause) || isa<ConstantAggregateZero>(Clause),
4561 Check(RI.getFunction()->hasPersonalityFn(),
4567 Check(LandingPadResultTy == RI.getValue()->getType(),
4579 Check(F->hasPersonalityFn(),
4582 Check(isa<CatchSwitchInst>(CPI.getParentPad()),
4588 Check(&*BB->getFirstNonPHIIt() == &CPI,
4596 Check(isa<CatchPadInst>(CatchReturn.getOperand(0)),
4607 Check(F->hasPersonalityFn(),
4612 Check(&*BB->getFirstNonPHIIt() == &CPI,
4616 Check(isa<ConstantTokenNone>(ParentPad) || isa<FuncletPadInst>(ParentPad),
4631 Check(Seen.insert(CurrentPad).second,
4660 Check(isa<CatchReturnInst>(U), "Bogus funclet pad use", U);
4710 Check(UnwindPad == FirstUnwindPad,
4773 Check(SwitchUnwindPad == FirstUnwindPad,
4787 Check(F->hasPersonalityFn(),
4793 Check(&*BB->getFirstNonPHIIt() == &CatchSwitch,
4798 Check(isa<ConstantTokenNone>(ParentPad) || isa<FuncletPadInst>(ParentPad),
4803 Check(I->isEHPad() && !isa<LandingPadInst>(I),
4813 Check(CatchSwitch.getNumHandlers() != 0,
4817 Check(isa<CatchPadInst>(Handler->getFirstNonPHIIt()),
4826 Check(isa<CleanupPadInst>(CRI.getOperand(0)),
4832 Check(I->isEHPad() && !isa<LandingPadInst>(I),
4862 Check(DT.dominates(Op, U), "Instruction does not dominate all uses!", Op, &I);
4866 Check(I.getType()->isPointerTy(),
4870 Check((isa<LoadInst>(I) || isa<IntToPtrInst>(I)),
4874 Check(MD->getNumOperands() == 1,
4879 Check(CI && CI->getType()->isIntegerTy(64),
4886 Check(MD->getNumOperands() >= 2,
4889 // Check first operand.
4890 Check(MD->getOperand(0) != nullptr, "first operand should not be null", MD);
4891 Check(isa<MDString>(MD->getOperand(0)),
4896 // Check consistency of !prof branch_weights metadata.
4900 Check(NumBranchWeights == 1 || NumBranchWeights == 2,
4920 Check(NumBranchWeights == ExpectedNumOperands, "Wrong number of operands",
4926 Check(MDO, "second operand should not be null", MD);
4927 Check(mdconst::dyn_extract<ConstantInt>(MDO),
4962 Check(canInstructionHaveMMRAs(I),
4973 Check(isa<MDTuple>(MD), "!mmra expected to be a metadata tuple", I, MD);
4975 Check(MMRAMetadata::isTagMD(MDOp.get()),
4982 Check(MD->getNumOperands() >= 1,
4986 Check(mdconst::dyn_extract_or_null<ConstantInt>(Op),
4991 Check(isa<CallBase>(I), "!memprof metadata should only exist on calls", &I);
4992 Check(MD->getNumOperands() >= 1,
4997 // Check each MIB
5003 Check(MIB->getNumOperands() >= 2,
5006 // Check call stack metadata (first operand).
5007 Check(MIB->getOperand(0) != nullptr,
5009 Check(isa<MDNode>(MIB->getOperand(0)),
5018 Check(I > 1,
5028 Check(OpNode, "Not all !memprof MemInfoBlock operands 2 to N are MDNode",
5030 Check(OpNode->getNumOperands() == 2,
5034 // Check that all of Op's operands are ConstantInt.
5035 Check(llvm::all_of(OpNode->operands(),
5047 Check(isa<CallBase>(I), "!callsite metadata should only exist on calls", &I);
5054 Check(isa<MDTuple>(Annotation), "annotation must be a tuple");
5055 Check(Annotation->getNumOperands() >= 1,
5063 Check(isa<MDString>(Op.get()) || TupleOfStrings,
5070 Check(NumOps >= 2 && NumOps <= 3, "scope must have two or three operands",
5072 Check(MD->getOperand(0).get() == MD || isa<MDString>(MD->getOperand(0)),
5075 Check(isa<MDString>(MD->getOperand(2)),
5079 Check(Domain != nullptr, "second scope operand must be MDNode", MD);
5082 Check(NumDomainOps >= 1 && NumDomainOps <= 2,
5084 Check(Domain->getOperand(0).get() == Domain ||
5088 Check(isa<MDString>(Domain->getOperand(1)),
5095 Check(OpMD != nullptr, "scope list must consist of MDNodes", MD);
5112 Check(OpMD != nullptr, "Access scope list must consist of MDNodes", MD);
5113 Check(IsValidAccessScope(OpMD),
5122 Check(BB, "Instruction not embedded in basic block!", &I);
5124 if (!isa<PHINode>(I)) { // Check that non-phi nodes are not self referential
5126 Check(U != (User *)&I || !DT.isReachableFromEntry(BB),
5131 // Check that void typed values don't have names
5132 Check(!I.getType()->isVoidTy() || !I.hasName(),
5135 // Check that the return value of the instruction is either void or a legal
5137 Check(I.getType()->isVoidTy() || I.getType()->isFirstClassType(),
5140 // Check that the instruction doesn't produce metadata. Calls are already
5142 Check(!I.getType()->isMetadataTy() || isa<CallInst>(I) || isa<InvokeInst>(I),
5145 // Check that all uses of the instruction, if they are instructions
5150 Check(Used->getParent() != nullptr,
5165 Check(I.getOperand(i) != nullptr, "Instruction has null operand!", &I);
5167 // Check to make sure that only first-class-values are operands to
5170 Check(false, "Instruction operands must be first-class values!", &I);
5182 // Check to make sure that the "address of" an intrinsic function is never
5186 Check((!F->isIntrinsic() ||
5190 Check(!F->isIntrinsic() || isa<CallInst>(I) ||
5211 Check(F->getParent() == &M, "Referencing function in another module!", &I,
5214 Check(OpBB->getParent() == BB->getParent(),
5217 Check(OpArg->getParent() == BB->getParent(),
5220 Check(GV->getParent() == &M, "Referencing global in another module!", &I,
5223 Check(OpInst->getFunction() == BB->getParent(),
5227 Check(CBI && &CBI->getCalledOperandUse() == &I.getOperandUse(i),
5241 Check(I.getType()->isFPOrFPVectorTy(),
5243 Check(MD->getNumOperands() == 1, "fpmath takes one operand!", &I);
5247 Check(&Accuracy.getSemantics() == &APFloat::IEEEsingle(),
5249 Check(Accuracy.isFiniteNonZero() && !Accuracy.isNegative(),
5252 Check(false, "invalid fpmath accuracy!", &I);
5257 Check(isa<LoadInst>(I) || isa<CallInst>(I) || isa<InvokeInst>(I),
5263 Check(isa<LoadInst>(I) || isa<StoreInst>(I) || isa<AtomicRMWInst>(I) ||
5270 Check(isa<LoadInst>(I) || isa<StoreInst>(I),
5275 Check(I.getType()->isPointerTy(), "nonnull applies only to pointer types",
5277 Check(isa<LoadInst>(I),
5281 Check(MD->getNumOperands() == 0, "nonnull metadata must be empty", &I);
5302 Check(I.getType()->isPointerTy(), "align applies only to pointer types",
5304 Check(isa<LoadInst>(I),
5308 Check(AlignMD->getNumOperands() == 1, "align takes one operand!", &I);
5310 Check(CI && CI->getType()->isIntegerTy(64),
5313 Check(isPowerOf2_64(Align), "align metadata value must be a power of 2!",
5315 Check(Align <= Value::MaximumAlignment,
5364 Check(IF->isDeclaration(), "Intrinsic functions should never be defined!",
5380 Check(Res != Intrinsic::MatchIntrinsicTypes_NoMatchRet,
5382 Check(Res != Intrinsic::MatchIntrinsicTypes_NoMatchArg,
5387 Check(!Intrinsic::matchIntrinsicVarArg(IsVarArg, TableRef),
5390 Check(!Intrinsic::matchIntrinsicVarArg(IsVarArg, TableRef),
5394 Check(TableRef.empty(), "Intrinsic has too few arguments!", IF);
5402 Check(ExpectedName == IF->getName(),
5414 Check(!Const->getType()->isX86_AMXTy(),
5427 Check(ArgCount == 2,
5429 Check(Call.getOperand(Elem.Begin)->getType()->isPointerTy() &&
5435 Check(Elem.Tag->getKey() == "ignore" ||
5441 Check(ArgCount <= 3 && ArgCount >= 2,
5443 Check(Call.getOperand(Elem.Begin)->getType()->isPointerTy(),
5445 Check(Call.getOperand(Elem.Begin + 1)->getType()->isIntegerTy(),
5448 Check(Call.getOperand(Elem.Begin + 2)->getType()->isIntegerTy(),
5452 Check(ArgCount <= 2, "too many arguments", Call);
5456 Check(ArgCount == 2, "this attribute should have 2 arguments", Call);
5457 Check(isa<ConstantInt>(Call.getOperand(Elem.Begin + 1)),
5460 Check((ArgCount) == 1, "this attribute should have one argument", Call);
5462 Check((ArgCount) == 0, "this attribute has no argument", Call);
5472 Check(DestTy->getScalarSizeInBits() >= 2,
5476 Check(SrcTy->isVectorTy() == IsDestTypeVector,
5483 Check(SrcVecLen == DestVecLen,
5495 Check(GV && GV->isConstant() && GV->hasDefinitiveInitializer(),
5499 Check(isa<ConstantStruct>(Init) || isa<ConstantArray>(Init),
5506 Check((TestMask->getZExtValue() & ~static_cast<unsigned>(fcAllFlags)) == 0,
5511 // Check the rounding mode
5517 Check(MD != nullptr, "missing rounding mode argument", Call);
5519 Check(isa<MDString>(MD),
5526 Check(RoundMode && *RoundMode != RoundingMode::Dynamic,
5542 Check(isa<MetadataAsValue>(Call.getArgOperand(0)),
5571 Check(ElementSizeVal.isPowerOf2(),
5579 Check(IsValidAlignment(AMI->getDestAlign()),
5582 Check(IsValidAlignment(AMT->getSourceAlign()),
5589 Check(NumArgs != nullptr,
5594 Check(UseCall != nullptr,
5599 Check(AllocArgIndex != nullptr,
5602 Check(AllocArgIndexInt.sge(0) &&
5611 Check(!FoundCall, "Can have at most one call corresponding to a "
5620 Check(NumPreallocatedArgs != 0,
5623 Check(NumArgs->equalsInt(NumPreallocatedArgs),
5637 Check(PreallocatedBundle,
5640 Check(PreallocatedBundle->Inputs.front().get() == &Call,
5649 Check(Token && Token->getCalledFunction()->getIntrinsicID() ==
5653 Check(Call.hasFnAttr(Attribute::Preallocated),
5660 Check(Token && Token->getCalledFunction()->getIntrinsicID() ==
5672 Check(AI, "llvm.gcroot parameter #1 must be an alloca.", Call);
5673 Check(isa<Constant>(Call.getArgOperand(1)),
5676 Check(!isa<ConstantPointerNull>(Call.getArgOperand(1)),
5683 Check(Call.getParent()->getParent()->hasGC(),
5687 Check(isa<Function>(Call.getArgOperand(1)->stripPointerCasts()),
5692 Check(cast<ConstantInt>(Call.getArgOperand(1))->getZExtValue() < 2,
5694 Check(cast<ConstantInt>(Call.getArgOperand(2))->getZExtValue() < 4,
5696 Check(cast<ConstantInt>(Call.getArgOperand(3))->getZExtValue() < 2,
5700 Check(isa<AllocaInst>(Call.getArgOperand(1)->stripPointerCasts()),
5705 Check(BB->isEntryBlock(), "llvm.localescape used outside of entry block",
5707 Check(!SawFrameEscape, "multiple calls to llvm.localescape in one function",
5713 Check(AI && AI->isStaticAlloca(),
5723 Check(Fn && !Fn->isDeclaration(),
5736 Check(!CI->isInlineAsm(),
5738 Check(Call.getParent()->getParent()->hasGC(),
5744 Check(Call.getParent()->getParent()->hasGC(),
5755 Check(StatepointFn && StatepointFn->isDeclaration() &&
5761 // Check that result type matches wrapped callee.
5764 Check(Call.getType() == TargetFuncType->getReturnType(),
5769 Check(Call.arg_size() == 3, "wrong number of arguments", Call);
5771 Check(isa<PointerType>(Call.getType()->getScalarType()),
5774 // Check that this relocate is correctly tied to the statepoint
5785 Check(InvokeBB, "safepoints should have unique landingpads",
5787 Check(InvokeBB->getTerminator(), "safepoint block should be well formed",
5789 Check(isa<GCStatepointInst>(InvokeBB->getTerminator()),
5796 Check(isa<GCStatepointInst>(Token) || isa<UndefValue>(Token),
5805 Check(isa<ConstantInt>(Base),
5809 Check(isa<ConstantInt>(Derived),
5815 // Check the bounds
5820 Check(BaseIndex < Opt->Inputs.size(),
5822 Check(DerivedIndex < Opt->Inputs.size(),
5835 Check(BaseType->isPtrOrPtrVectorTy(),
5837 Check(DerivedType->isPtrOrPtrVectorTy(),
5840 Check(ResultType->isVectorTy() == DerivedType->isVectorTy(),
5843 Check(
5850 Check(GC, "gc.relocate: calling function must have GCStrategy",
5856 Check(isGCPtr(ResultType), "gc.relocate: must return gc pointer", Call);
5857 Check(isGCPtr(BaseType),
5859 Check(isGCPtr(DerivedType),
5866 Check(Call.getType()->isSingleValueType(),
5873 Check(isa<CatchPadInst>(Call.getArgOperand(0)),
5878 Check(Call.getType()->isVectorTy(),
5883 Check(ElemTy->isIntegerTy(1),
5891 Check(!VF->isNegative() && !VF->isZero(),
5896 Check(Call.getType()->isVectorTy(), "masked_load: must return a vector",
5902 Check(Mask->getType()->isVectorTy(), "masked_load: mask must be vector",
5904 Check(Alignment->getValue().isPowerOf2(),
5906 Check(PassThru->getType() == Call.getType(),
5908 Check(cast<VectorType>(Mask->getType())->getElementCount() ==
5917 Check(Mask->getType()->isVectorTy(), "masked_store: mask must be vector",
5919 Check(Alignment->getValue().isPowerOf2(),
5921 Check(cast<VectorType>(Mask->getType())->getElementCount() ==
5930 Check(Alignment.isZero() || Alignment.isPowerOf2(),
5937 Check(Alignment.isZero() || Alignment.isPowerOf2(),
5943 Check(isa<CallInst>(Call), "experimental_guard cannot be invoked", Call);
5944 Check(Call.countOperandBundlesOfType(LLVMContext::OB_deopt) == 1,
5951 Check(isa<CallInst>(Call), "experimental_deoptimize cannot be invoked",
5953 Check(Call.countOperandBundlesOfType(LLVMContext::OB_deopt) == 1,
5956 Check(Call.getType() == Call.getFunction()->getReturnType(),
5961 Check(RI,
5965 Check(RI->getReturnValue() == &Call,
5973 Check(Call.getFunction()->isVarArg(),
5987 Check(ArgTy->isIntOrIntVectorTy() && ArgTy->isVectorTy(),
5994 Check(ArgTy->isFPOrFPVectorTy() && ArgTy->isVectorTy(),
6003 Check(ArgTy->isFPOrFPVectorTy() && ArgTy->isVectorTy(),
6017 Check(Op1->getType()->isIntOrIntVectorTy(),
6020 Check(Op2->getType()->isIntOrIntVectorTy(),
6025 Check(Op3->getType()->isIntegerTy(),
6027 Check(Op3->getBitWidth() <= 32,
6032 Check(Op3->getZExtValue() < Op1->getType()->getScalarSizeInBits(),
6036 Check(Op3->getZExtValue() <= Op1->getType()->getScalarSizeInBits(),
6050 Check(ValTy->isFPOrFPVectorTy() && ResultTy->isIntOrIntVectorTy(),
6055 Check(ValTy->isVectorTy() == ResultTy->isVectorTy(),
6058 Check(VTy->getElementCount() == RTy->getElementCount(),
6066 Check(Size % 16 == 0, "bswap must be an even number of bytes", &Call);
6071 Check(InvariantSize &&
6093 Check(cast<FixedVectorType>(Call.getArgOperand(0)->getType())
6098 Check(cast<FixedVectorType>(Call.getArgOperand(1)->getType())
6138 Check(ResultTy->getElementType()->isIntegerTy() ||
6143 Check(ResultTy->getElementType() == Op0ElemTy,
6149 Check(ResultTy->getElementType() == Op1ElemTy,
6154 Check(cast<FixedVectorType>(ResultTy)->getNumElements() ==
6159 Check(Stride->getZExtValue() >= NumRows->getZExtValue(),
6173 Check((Idx < 0 && std::abs(Idx) <= KnownMinNumElements) ||
6184 Check(VecTy && VecTy->getScalarType()->isIntegerTy() &&
6200 Check(Op1Ty && Op2Ty && MaskTy, "Operands must be vectors.", &Call);
6201 Check(isa<FixedVectorType>(Op2Ty),
6203 Check(Op1Ty->getElementType()->isIntegerTy(),
6205 Check(Op1Ty->getElementType() == Op2Ty->getElementType(),
6207 Check(Op1Ty->getElementCount() == MaskTy->getElementCount(),
6210 Check(MaskTy->getElementType()->isIntegerTy(1),
6212 Check(Call.getType() == MaskTy, "Return type must match the mask type.",
6227 Check(VecTy->getElementType() == SubVecTy->getElementType(),
6231 Check(IdxN % SubVecEC.getKnownMinValue() == 0,
6239 Check(IdxN < VecEC.getKnownMinValue() &&
6257 Check(ResultTy->getElementType() == VecTy->getElementType(),
6261 Check(IdxN % ResultEC.getKnownMinValue() == 0,
6269 Check(IdxN < VecEC.getKnownMinValue() &&
6282 Check((VecWidth % AccWidth) == 0,
6300 Check(ElemTy, "Intrinsic requires elementtype attribute on first argument.",
6309 Check(ElemTy,
6315 Check(cast<ConstantInt>(Call.getArgOperand(1))->getZExtValue() < 2,
6317 Check(cast<ConstantInt>(Call.getArgOperand(2))->getZExtValue() < 4,
6319 Check(cast<ConstantInt>(Call.getArgOperand(3))->getZExtValue() < 2,
6321 Check(cast<ConstantInt>(Call.getArgOperand(4))->getZExtValue() < 2,
6327 Check(CBR, "intrinstic requires callbr operand", &Call);
6342 Check(llvm::is_contained(CBR->getIndirectDests(), LandingPadBB),
6347 Check(&First == &Call, "No other instructions may proceed intrinsic",
6366 Check(Call.paramHasAttr(2, Attribute::InReg),
6368 Check(!Call.paramHasAttr(3, Attribute::InReg),
6387 Check(!Call.paramHasAttr(InactiveIdx, Attribute::InReg),
6390 Check(isa<Argument>(Call.getArgOperand(InactiveIdx)),
6392 Check(!cast<Argument>(Call.getArgOperand(InactiveIdx))->hasInRegAttr(),
6397 Check(
6410 Check(CBSZ <= 4, "invalid value for cbsz format", Call,
6412 Check(BLGP <= 4, "invalid value for blgp format", Call,
6440 Check(isValidSrcASrcBVector(Src0Ty),
6442 Check(isValidSrcASrcBVector(Src1Ty),
6446 Check(Src0Ty->getNumElements() >= getFormatNumRegs(CBSZ),
6448 Check(Src1Ty->getNumElements() >= getFormatNumRegs(BLGP),
6456 Check(RegCount % 8 == 0,
6458 Check((RegCount >= 24 && RegCount <= 256),
6470 Check(Ty0->isPtrOrPtrVectorTy(),
6474 Check(
6479 Check(cast<VectorType>(Ty0)->getElementCount() ==
6484 Check(DL.getIndexTypeSizeInBits(Ty0) == Ty1->getScalarSizeInBits(),
6492 Check(isa<GlobalValue>(Arg0),
6494 Check(cast<GlobalValue>(Arg0).isThreadLocal(),
6503 Check(size == 128, " The only supported value for size operand is 128");
6518 // Check for catch-/cleanup-pad in first funclet block
6529 // Check for funclet operand bundle
6537 Check(HasToken, "Missing funclet token on intrinsic call", &Call);
6674 Check(RetTy->getElementCount() == ValTy->getElementCount(),
6683 Check(RetTy->isIntOrIntVectorTy() && ValTy->isIntOrIntVectorTy(),
6687 Check(RetTy->getScalarSizeInBits() < ValTy->getScalarSizeInBits(),
6694 Check(RetTy->isIntOrIntVectorTy() && ValTy->isIntOrIntVectorTy(),
6698 Check(RetTy->getScalarSizeInBits() > ValTy->getScalarSizeInBits(),
6707 Check(
6715 Check(
6722 Check(RetTy->isFPOrFPVectorTy() && ValTy->isFPOrFPVectorTy(),
6726 Check(RetTy->getScalarSizeInBits() < ValTy->getScalarSizeInBits(),
6732 Check(RetTy->isFPOrFPVectorTy() && ValTy->isFPOrFPVectorTy(),
6736 Check(RetTy->getScalarSizeInBits() > ValTy->getScalarSizeInBits(),
6742 Check(RetTy->isIntOrIntVectorTy() && ValTy->isPtrOrPtrVectorTy(),
6748 Check(RetTy->isPtrOrPtrVectorTy() && ValTy->isIntOrIntVectorTy(),
6757 Check(CmpInst::isFPPredicate(Pred),
6762 Check(CmpInst::isIntPredicate(Pred),
6767 Check((TestMask->getZExtValue() & ~static_cast<unsigned>(fcAllFlags)) == 0,
6783 Check((FPI.arg_size() == NumOperands),
6791 Check(!ValTy->isVectorTy() && !ResultTy->isVectorTy(),
6800 Check(!ValTy->isVectorTy() && !ResultTy->isVectorTy(),
6808 Check(CmpInst::isFPPredicate(Pred),
6817 Check(Operand->getType()->isFPOrFPVectorTy(),
6824 Check(SrcEC.isNonZero() == Operand->getType()->isVectorTy(),
6826 Check(Operand->getType()->isIntOrIntVectorTy(),
6829 Check(SrcEC == cast<VectorType>(OperandT)->getElementCount(),
6840 Check(Operand->getType()->isIntOrIntVectorTy(),
6847 Check(SrcEC.isNonZero() == Operand->getType()->isVectorTy(),
6849 Check(Operand->getType()->isFPOrFPVectorTy(),
6852 Check(SrcEC == cast<VectorType>(OperandT)->getElementCount(),
6865 Check(OperandTy->isFPOrFPVectorTy(),
6867 Check(ResultTy->isFPOrFPVectorTy(),
6869 Check(OperandTy->isVectorTy() == ResultTy->isVectorTy(),
6872 Check(cast<VectorType>(OperandTy)->getElementCount() ==
6878 Check(OperandTy->getScalarSizeInBits() > ResultTy->getScalarSizeInBits(),
6882 Check(OperandTy->getScalarSizeInBits() < ResultTy->getScalarSizeInBits(),
6898 Check(FPI.getExceptionBehavior().has_value(),
6901 Check(FPI.getRoundingMode().has_value(), "invalid rounding mode argument",
6984 Check(Loc, "llvm.dbg." + Kind + " intrinsic requires a !dbg attachment", &DLI,
7190 Check(First->getCallingConv() == F->getCallingConv(),
7201 Check((FTy->getReturnType()->isPointerTy() ||
7208 Check(BU.Inputs.size() == 1 && isa<Function>(BU.Inputs.front()),
7217 Check((IID == Intrinsic::objc_retainAutoreleasedReturnValue ||
7222 Check((FnName == "objc_retainAutoreleasedReturnValue" ||
7238 Check(ScopeListMV != nullptr,
7244 Check(ScopeListMD != nullptr, "!id.scope.list must point to an MDNode", II);
7245 Check(ScopeListMD->getNumOperands() == 1,
7289 Check(!DT.dominates(I, J),
7441 // Check the type size field.
7451 // Check the type name field. In the new format it can be anything.
7645 // Check the access size field.
7652 // Check the immutability flag.