Lines Matching refs:CxtI
105 const Instruction *CxtI; member
115 Query(const DataLayout &DL, AssumptionCache *AC, const Instruction *CxtI, in Query()
118 : DL(DL), AC(AC), CxtI(CxtI), DT(DT), ORE(ORE), IIQ(UseInstrInfo) {} in Query()
125 static const Instruction *safeCxtI(const Value *V, const Instruction *CxtI) { in safeCxtI() argument
128 if (CxtI && CxtI->getParent()) in safeCxtI()
129 return CxtI; in safeCxtI()
132 CxtI = dyn_cast<Instruction>(V); in safeCxtI()
133 if (CxtI && CxtI->getParent()) in safeCxtI()
134 return CxtI; in safeCxtI()
139 static const Instruction *safeCxtI(const Value *V1, const Value *V2, const Instruction *CxtI) { in safeCxtI() argument
142 if (CxtI && CxtI->getParent()) in safeCxtI()
143 return CxtI; in safeCxtI()
146 CxtI = dyn_cast<Instruction>(V1); in safeCxtI()
147 if (CxtI && CxtI->getParent()) in safeCxtI()
148 return CxtI; in safeCxtI()
150 CxtI = dyn_cast<Instruction>(V2); in safeCxtI()
151 if (CxtI && CxtI->getParent()) in safeCxtI()
152 return CxtI; in safeCxtI()
215 AssumptionCache *AC, const Instruction *CxtI, in computeKnownBits() argument
219 Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo, ORE)); in computeKnownBits()
225 const Instruction *CxtI, const DominatorTree *DT, in computeKnownBits() argument
228 Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo, ORE)); in computeKnownBits()
239 const Instruction *CxtI, in computeKnownBits() argument
244 V, Depth, Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo, ORE)); in computeKnownBits()
249 AssumptionCache *AC, const Instruction *CxtI, in computeKnownBits() argument
255 Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo, ORE)); in computeKnownBits()
260 const Instruction *CxtI, const DominatorTree *DT, in haveNoCommonBitsSet() argument
277 computeKnownBits(LHS, LHSKnown, DL, 0, AC, CxtI, DT, nullptr, UseInstrInfo); in haveNoCommonBitsSet()
278 computeKnownBits(RHS, RHSKnown, DL, 0, AC, CxtI, DT, nullptr, UseInstrInfo); in haveNoCommonBitsSet()
282 bool llvm::isOnlyUsedInZeroEqualityComparison(const Instruction *CxtI) { in isOnlyUsedInZeroEqualityComparison() argument
283 for (const User *U : CxtI->users()) { in isOnlyUsedInZeroEqualityComparison()
299 AssumptionCache *AC, const Instruction *CxtI, in isKnownToBeAPowerOfTwo() argument
302 V, OrZero, Depth, Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo)); in isKnownToBeAPowerOfTwo()
311 AssumptionCache *AC, const Instruction *CxtI, in isKnownNonZero() argument
314 Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo)); in isKnownNonZero()
319 const Instruction *CxtI, const DominatorTree *DT, in isKnownNonNegative() argument
322 computeKnownBits(V, DL, Depth, AC, CxtI, DT, nullptr, UseInstrInfo); in isKnownNonNegative()
327 AssumptionCache *AC, const Instruction *CxtI, in isKnownPositive() argument
334 return isKnownNonNegative(V, DL, Depth, AC, CxtI, DT, UseInstrInfo) && in isKnownPositive()
335 isKnownNonZero(V, DL, Depth, AC, CxtI, DT, UseInstrInfo); in isKnownPositive()
339 AssumptionCache *AC, const Instruction *CxtI, in isKnownNegative() argument
342 computeKnownBits(V, DL, Depth, AC, CxtI, DT, nullptr, UseInstrInfo); in isKnownNegative()
351 const Instruction *CxtI, const DominatorTree *DT, in isKnownNonEqual() argument
354 Query(DL, AC, safeCxtI(V2, V1, CxtI), DT, in isKnownNonEqual()
363 AssumptionCache *AC, const Instruction *CxtI, in MaskedValueIsZero() argument
366 V, Mask, Depth, Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo)); in MaskedValueIsZero()
387 const Instruction *CxtI, in ComputeNumSignBits() argument
390 V, Depth, Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo)); in ComputeNumSignBits()
522 const Instruction *CxtI, in isValidAssumeForContext() argument
532 if (Inv->getParent() == CxtI->getParent()) { in isValidAssumeForContext()
535 if (Inv->comesBefore(CxtI)) in isValidAssumeForContext()
541 if (Inv == CxtI) in isValidAssumeForContext()
551 for (BasicBlock::const_iterator I(CxtI), IE(Inv); I != IE; ++I) in isValidAssumeForContext()
555 return !isEphemeralValueOf(Inv, CxtI); in isValidAssumeForContext()
560 if (DT->dominates(Inv, CxtI)) in isValidAssumeForContext()
562 } else if (Inv->getParent() == CxtI->getParent()->getSinglePredecessor()) { in isValidAssumeForContext()
591 if (!Q.AC || !Q.CxtI) in isKnownNonZeroFromAssume()
594 if (Q.CxtI && V->getType()->isPointerTy()) { in isKnownNonZeroFromAssume()
596 if (!NullPointerIsDefined(Q.CxtI->getFunction(), in isKnownNonZeroFromAssume()
600 if (getKnowledgeValidInContext(V, AttrKinds, Q.CxtI, Q.DT, Q.AC)) in isKnownNonZeroFromAssume()
608 assert(I->getFunction() == Q.CxtI->getFunction() && in isKnownNonZeroFromAssume()
624 if (cmpExcludesZero(Pred, RHS) && isValidAssumeForContext(I, Q.CxtI, Q.DT)) in isKnownNonZeroFromAssume()
635 if (!Q.AC || !Q.CxtI) in computeKnownBitsFromAssume()
643 V, {Attribute::Alignment}, Q.CxtI, Q.DT, Q.AC)) { in computeKnownBitsFromAssume()
655 assert(I->getParent()->getParent() == Q.CxtI->getParent()->getParent() && in computeKnownBitsFromAssume()
667 if (Arg == V && isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
673 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
708 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
716 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
729 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
742 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
755 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
768 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
784 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
800 isValidAssumeForContext(I, Q.CxtI, Q.DT) && C < BitWidth) { in computeKnownBitsFromAssume()
813 isValidAssumeForContext(I, Q.CxtI, Q.DT) && C < BitWidth) { in computeKnownBitsFromAssume()
825 isValidAssumeForContext(I, Q.CxtI, Q.DT) && C < BitWidth) { in computeKnownBitsFromAssume()
835 isValidAssumeForContext(I, Q.CxtI, Q.DT) && C < BitWidth) { in computeKnownBitsFromAssume()
847 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
860 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
873 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
886 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
899 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
910 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
943 auto *CxtI = const_cast<Instruction *>(Q.CxtI); in computeKnownBitsFromAssume() local
945 CxtI) in computeKnownBitsFromAssume()
1419 RecQ.CxtI = P; in computeKnownBitsFromOperator()
1459 RecQ.CxtI = RInst; in computeKnownBitsFromOperator()
1464 RecQ.CxtI = LInst; in computeKnownBitsFromOperator()
1530 RecQ.CxtI = P->getIncomingBlock(u)->getTerminator(); in computeKnownBitsFromOperator()
1801 if (isGuaranteedNotToBePoison(I->getOperand(0), Q.AC, Q.CxtI, Q.DT, in computeKnownBitsFromOperator()
2378 if (isKnownNonNullFromDominatingCondition(V, Q.CxtI, Q.DT)) in isKnownNonZero()
2524 RecQ.CxtI = PN->getIncomingBlock(U)->getTerminator(); in isKnownNonZero()
2545 isGuaranteedNotToBePoison(Op, Q.AC, Q.CxtI, Q.DT, Depth)) in isKnownNonZero()
2738 RecQ.CxtI = IncomBB->getTerminator(); in isNonEqualPHIs()
3122 RecQ.CxtI = PN->getIncomingBlock(i)->getTerminator(); in ComputeNumSignBitsImpl()
4690 AssumptionCache *AC, const Instruction *CxtI, const DominatorTree *DT, in computeConstantRangeIncludingKnownBits() argument
4693 V, DL, Depth, AC, CxtI, DT, ORE, UseInstrInfo); in computeConstantRangeIncludingKnownBits()
4703 AssumptionCache *AC, const Instruction *CxtI, const DominatorTree *DT, in computeOverflowForUnsignedMul() argument
4705 KnownBits LHSKnown = computeKnownBits(LHS, DL, /*Depth=*/0, AC, CxtI, DT, in computeOverflowForUnsignedMul()
4707 KnownBits RHSKnown = computeKnownBits(RHS, DL, /*Depth=*/0, AC, CxtI, DT, in computeOverflowForUnsignedMul()
4717 const Instruction *CxtI, in computeOverflowForSignedMul() argument
4729 unsigned SignBits = ComputeNumSignBits(LHS, DL, 0, AC, CxtI, DT) + in computeOverflowForSignedMul()
4730 ComputeNumSignBits(RHS, DL, 0, AC, CxtI, DT); in computeOverflowForSignedMul()
4747 KnownBits LHSKnown = computeKnownBits(LHS, DL, /*Depth=*/0, AC, CxtI, DT, in computeOverflowForSignedMul()
4749 KnownBits RHSKnown = computeKnownBits(RHS, DL, /*Depth=*/0, AC, CxtI, DT, in computeOverflowForSignedMul()
4759 AssumptionCache *AC, const Instruction *CxtI, const DominatorTree *DT, in computeOverflowForUnsignedAdd() argument
4762 LHS, /*ForSigned=*/false, DL, /*Depth=*/0, AC, CxtI, DT, in computeOverflowForUnsignedAdd()
4765 RHS, /*ForSigned=*/false, DL, /*Depth=*/0, AC, CxtI, DT, in computeOverflowForUnsignedAdd()
4775 const Instruction *CxtI, in computeOverflowForSignedAdd() argument
4795 if (ComputeNumSignBits(LHS, DL, 0, AC, CxtI, DT) > 1 && in computeOverflowForSignedAdd()
4796 ComputeNumSignBits(RHS, DL, 0, AC, CxtI, DT) > 1) in computeOverflowForSignedAdd()
4800 LHS, /*ForSigned=*/true, DL, /*Depth=*/0, AC, CxtI, DT); in computeOverflowForSignedAdd()
4802 RHS, /*ForSigned=*/true, DL, /*Depth=*/0, AC, CxtI, DT); in computeOverflowForSignedAdd()
4824 Add, AddKnown, /*Depth=*/0, Query(DL, AC, CxtI, DT, true)); in computeOverflowForSignedAdd()
4837 const Instruction *CxtI, in computeOverflowForUnsignedSub() argument
4841 if (match(CxtI, in computeOverflowForUnsignedSub()
4844 isImpliedByDomCondition(CmpInst::ICMP_UGE, LHS, RHS, CxtI, DL)) { in computeOverflowForUnsignedSub()
4850 LHS, /*ForSigned=*/false, DL, /*Depth=*/0, AC, CxtI, DT); in computeOverflowForUnsignedSub()
4852 RHS, /*ForSigned=*/false, DL, /*Depth=*/0, AC, CxtI, DT); in computeOverflowForUnsignedSub()
4860 const Instruction *CxtI, in computeOverflowForSignedSub() argument
4864 if (ComputeNumSignBits(LHS, DL, 0, AC, CxtI, DT) > 1 && in computeOverflowForSignedSub()
4865 ComputeNumSignBits(RHS, DL, 0, AC, CxtI, DT) > 1) in computeOverflowForSignedSub()
4869 LHS, /*ForSigned=*/true, DL, /*Depth=*/0, AC, CxtI, DT); in computeOverflowForSignedSub()
4871 RHS, /*ForSigned=*/true, DL, /*Depth=*/0, AC, CxtI, DT); in computeOverflowForSignedSub()
5251 const Instruction *CxtI, in computeOverflowForSignedAdd() argument
5254 Add, DL, AC, CxtI, DT); in computeOverflowForSignedAdd()
5261 const Instruction *CxtI, in computeOverflowForSignedAdd() argument
5263 return ::computeOverflowForSignedAdd(LHS, RHS, nullptr, DL, AC, CxtI, DT); in computeOverflowForSignedAdd()