Lines Matching refs:CxtI
114 const Instruction *CxtI; member
124 Query(const DataLayout &DL, AssumptionCache *AC, const Instruction *CxtI, in Query()
127 : DL(DL), AC(AC), CxtI(CxtI), DT(DT), ORE(ORE), IIQ(UseInstrInfo) {} in Query()
134 static const Instruction *safeCxtI(const Value *V, const Instruction *CxtI) { in safeCxtI() argument
137 if (CxtI && CxtI->getParent()) in safeCxtI()
138 return CxtI; in safeCxtI()
141 CxtI = dyn_cast<Instruction>(V); in safeCxtI()
142 if (CxtI && CxtI->getParent()) in safeCxtI()
143 return CxtI; in safeCxtI()
148 static const Instruction *safeCxtI(const Value *V1, const Value *V2, const Instruction *CxtI) { in safeCxtI() argument
151 if (CxtI && CxtI->getParent()) in safeCxtI()
152 return CxtI; in safeCxtI()
155 CxtI = dyn_cast<Instruction>(V1); in safeCxtI()
156 if (CxtI && CxtI->getParent()) in safeCxtI()
157 return CxtI; in safeCxtI()
159 CxtI = dyn_cast<Instruction>(V2); in safeCxtI()
160 if (CxtI && CxtI->getParent()) in safeCxtI()
161 return CxtI; in safeCxtI()
224 AssumptionCache *AC, const Instruction *CxtI, in computeKnownBits() argument
228 Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo, ORE)); in computeKnownBits()
234 const Instruction *CxtI, const DominatorTree *DT, in computeKnownBits() argument
237 Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo, ORE)); in computeKnownBits()
248 const Instruction *CxtI, in computeKnownBits() argument
253 V, Depth, Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo, ORE)); in computeKnownBits()
258 AssumptionCache *AC, const Instruction *CxtI, in computeKnownBits() argument
264 Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo, ORE)); in computeKnownBits()
269 const Instruction *CxtI, const DominatorTree *DT, in haveNoCommonBitsSet() argument
312 computeKnownBits(LHS, LHSKnown, DL, 0, AC, CxtI, DT, nullptr, UseInstrInfo); in haveNoCommonBitsSet()
313 computeKnownBits(RHS, RHSKnown, DL, 0, AC, CxtI, DT, nullptr, UseInstrInfo); in haveNoCommonBitsSet()
329 AssumptionCache *AC, const Instruction *CxtI, in isKnownToBeAPowerOfTwo() argument
332 V, OrZero, Depth, Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo)); in isKnownToBeAPowerOfTwo()
341 AssumptionCache *AC, const Instruction *CxtI, in isKnownNonZero() argument
344 Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo)); in isKnownNonZero()
349 const Instruction *CxtI, const DominatorTree *DT, in isKnownNonNegative() argument
352 computeKnownBits(V, DL, Depth, AC, CxtI, DT, nullptr, UseInstrInfo); in isKnownNonNegative()
357 AssumptionCache *AC, const Instruction *CxtI, in isKnownPositive() argument
364 return isKnownNonNegative(V, DL, Depth, AC, CxtI, DT, UseInstrInfo) && in isKnownPositive()
365 isKnownNonZero(V, DL, Depth, AC, CxtI, DT, UseInstrInfo); in isKnownPositive()
369 AssumptionCache *AC, const Instruction *CxtI, in isKnownNegative() argument
372 computeKnownBits(V, DL, Depth, AC, CxtI, DT, nullptr, UseInstrInfo); in isKnownNegative()
381 const Instruction *CxtI, const DominatorTree *DT, in isKnownNonEqual() argument
384 Query(DL, AC, safeCxtI(V2, V1, CxtI), DT, in isKnownNonEqual()
393 AssumptionCache *AC, const Instruction *CxtI, in MaskedValueIsZero() argument
396 V, Mask, Depth, Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo)); in MaskedValueIsZero()
417 const Instruction *CxtI, in ComputeNumSignBits() argument
420 V, Depth, Query(DL, AC, safeCxtI(V, CxtI), DT, UseInstrInfo)); in ComputeNumSignBits()
425 const Instruction *CxtI, in ComputeMaxSignificantBits() argument
427 unsigned SignBits = ComputeNumSignBits(V, DL, Depth, AC, CxtI, DT); in ComputeMaxSignificantBits()
482 isGuaranteedNotToBeUndefOrPoison(Op0, Q.AC, Q.CxtI, Q.DT, Depth + 1); in computeKnownBitsMul()
567 const Instruction *CxtI, in isValidAssumeForContext() argument
577 if (Inv->getParent() == CxtI->getParent()) { in isValidAssumeForContext()
580 if (Inv->comesBefore(CxtI)) in isValidAssumeForContext()
586 if (Inv == CxtI) in isValidAssumeForContext()
595 auto Range = make_range(CxtI->getIterator(), Inv->getIterator()); in isValidAssumeForContext()
599 return !isEphemeralValueOf(Inv, CxtI); in isValidAssumeForContext()
604 if (DT->dominates(Inv, CxtI)) in isValidAssumeForContext()
606 } else if (Inv->getParent() == CxtI->getParent()->getSinglePredecessor()) { in isValidAssumeForContext()
635 if (!Q.AC || !Q.CxtI) in isKnownNonZeroFromAssume()
638 if (Q.CxtI && V->getType()->isPointerTy()) { in isKnownNonZeroFromAssume()
640 if (!NullPointerIsDefined(Q.CxtI->getFunction(), in isKnownNonZeroFromAssume()
644 if (getKnowledgeValidInContext(V, AttrKinds, Q.CxtI, Q.DT, Q.AC)) in isKnownNonZeroFromAssume()
652 assert(I->getFunction() == Q.CxtI->getFunction() && in isKnownNonZeroFromAssume()
668 if (cmpExcludesZero(Pred, RHS) && isValidAssumeForContext(I, Q.CxtI, Q.DT)) in isKnownNonZeroFromAssume()
679 if (!Q.AC || !Q.CxtI) in computeKnownBitsFromAssume()
687 V, {Attribute::Alignment}, Q.CxtI, Q.DT, Q.AC)) { in computeKnownBitsFromAssume()
700 assert(I->getParent()->getParent() == Q.CxtI->getParent()->getParent() && in computeKnownBitsFromAssume()
712 if (Arg == V && isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
718 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
753 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
761 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
774 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
787 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
800 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
813 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
829 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
845 isValidAssumeForContext(I, Q.CxtI, Q.DT) && C < BitWidth) { in computeKnownBitsFromAssume()
858 isValidAssumeForContext(I, Q.CxtI, Q.DT) && C < BitWidth) { in computeKnownBitsFromAssume()
870 isValidAssumeForContext(I, Q.CxtI, Q.DT) && C < BitWidth) { in computeKnownBitsFromAssume()
880 isValidAssumeForContext(I, Q.CxtI, Q.DT) && C < BitWidth) { in computeKnownBitsFromAssume()
892 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
905 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
918 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
931 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
944 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
955 isValidAssumeForContext(I, Q.CxtI, Q.DT)) { in computeKnownBitsFromAssume()
988 auto *CxtI = const_cast<Instruction *>(Q.CxtI); in computeKnownBitsFromAssume() local
990 CxtI) in computeKnownBitsFromAssume()
1464 RecQ.CxtI = P; in computeKnownBitsFromOperator()
1504 RecQ.CxtI = RInst; in computeKnownBitsFromOperator()
1509 RecQ.CxtI = LInst; in computeKnownBitsFromOperator()
1575 RecQ.CxtI = P->getIncomingBlock(u)->getTerminator(); in computeKnownBitsFromOperator()
1874 if (isGuaranteedNotToBePoison(I->getOperand(0), Q.AC, Q.CxtI, Q.DT, in computeKnownBitsFromOperator()
2053 Q.CxtI = PN->getIncomingBlock(U)->getTerminator(); in isPowerOfTwoRecurrence()
2064 Q.CxtI = BO->getParent()->getTerminator(); in isPowerOfTwoRecurrence()
2206 RecQ.CxtI = PN->getIncomingBlock(U)->getTerminator(); in isKnownToBeAPowerOfTwo()
2532 if (isKnownNonNullFromDominatingCondition(V, Q.CxtI, Q.DT)) in isKnownNonZero()
2678 RecQ.CxtI = PN->getIncomingBlock(U)->getTerminator(); in isKnownNonZero()
2699 isGuaranteedNotToBePoison(Op, Q.AC, Q.CxtI, Q.DT, Depth)) in isKnownNonZero()
2894 RecQ.CxtI = IncomBB->getTerminator(); in isNonEqualPHIs()
3296 RecQ.CxtI = PN->getIncomingBlock(i)->getTerminator(); in ComputeNumSignBitsImpl()
4833 AssumptionCache *AC, const Instruction *CxtI, const DominatorTree *DT, in computeConstantRangeIncludingKnownBits() argument
4836 V, DL, Depth, AC, CxtI, DT, ORE, UseInstrInfo); in computeConstantRangeIncludingKnownBits()
4846 AssumptionCache *AC, const Instruction *CxtI, const DominatorTree *DT, in computeOverflowForUnsignedMul() argument
4848 KnownBits LHSKnown = computeKnownBits(LHS, DL, /*Depth=*/0, AC, CxtI, DT, in computeOverflowForUnsignedMul()
4850 KnownBits RHSKnown = computeKnownBits(RHS, DL, /*Depth=*/0, AC, CxtI, DT, in computeOverflowForUnsignedMul()
4860 const Instruction *CxtI, in computeOverflowForSignedMul() argument
4872 unsigned SignBits = ComputeNumSignBits(LHS, DL, 0, AC, CxtI, DT) + in computeOverflowForSignedMul()
4873 ComputeNumSignBits(RHS, DL, 0, AC, CxtI, DT); in computeOverflowForSignedMul()
4890 KnownBits LHSKnown = computeKnownBits(LHS, DL, /*Depth=*/0, AC, CxtI, DT, in computeOverflowForSignedMul()
4892 KnownBits RHSKnown = computeKnownBits(RHS, DL, /*Depth=*/0, AC, CxtI, DT, in computeOverflowForSignedMul()
4902 AssumptionCache *AC, const Instruction *CxtI, const DominatorTree *DT, in computeOverflowForUnsignedAdd() argument
4905 LHS, /*ForSigned=*/false, DL, /*Depth=*/0, AC, CxtI, DT, in computeOverflowForUnsignedAdd()
4908 RHS, /*ForSigned=*/false, DL, /*Depth=*/0, AC, CxtI, DT, in computeOverflowForUnsignedAdd()
4918 const Instruction *CxtI, in computeOverflowForSignedAdd() argument
4938 if (ComputeNumSignBits(LHS, DL, 0, AC, CxtI, DT) > 1 && in computeOverflowForSignedAdd()
4939 ComputeNumSignBits(RHS, DL, 0, AC, CxtI, DT) > 1) in computeOverflowForSignedAdd()
4943 LHS, /*ForSigned=*/true, DL, /*Depth=*/0, AC, CxtI, DT); in computeOverflowForSignedAdd()
4945 RHS, /*ForSigned=*/true, DL, /*Depth=*/0, AC, CxtI, DT); in computeOverflowForSignedAdd()
4967 Add, AddKnown, /*Depth=*/0, Query(DL, AC, CxtI, DT, true)); in computeOverflowForSignedAdd()
4980 const Instruction *CxtI, in computeOverflowForUnsignedSub() argument
4995 if (isGuaranteedNotToBeUndefOrPoison(LHS, AC, CxtI, DT)) in computeOverflowForUnsignedSub()
5000 if (match(CxtI, in computeOverflowForUnsignedSub()
5003 isImpliedByDomCondition(CmpInst::ICMP_UGE, LHS, RHS, CxtI, DL)) { in computeOverflowForUnsignedSub()
5009 LHS, /*ForSigned=*/false, DL, /*Depth=*/0, AC, CxtI, DT); in computeOverflowForUnsignedSub()
5011 RHS, /*ForSigned=*/false, DL, /*Depth=*/0, AC, CxtI, DT); in computeOverflowForUnsignedSub()
5019 const Instruction *CxtI, in computeOverflowForSignedSub() argument
5031 if (isGuaranteedNotToBeUndefOrPoison(LHS, AC, CxtI, DT)) in computeOverflowForSignedSub()
5036 if (ComputeNumSignBits(LHS, DL, 0, AC, CxtI, DT) > 1 && in computeOverflowForSignedSub()
5037 ComputeNumSignBits(RHS, DL, 0, AC, CxtI, DT) > 1) in computeOverflowForSignedSub()
5041 LHS, /*ForSigned=*/true, DL, /*Depth=*/0, AC, CxtI, DT); in computeOverflowForSignedSub()
5043 RHS, /*ForSigned=*/true, DL, /*Depth=*/0, AC, CxtI, DT); in computeOverflowForSignedSub()
5415 const Instruction *CxtI, in computeOverflowForSignedAdd() argument
5418 Add, DL, AC, CxtI, DT); in computeOverflowForSignedAdd()
5425 const Instruction *CxtI, in computeOverflowForSignedAdd() argument
5427 return ::computeOverflowForSignedAdd(LHS, RHS, nullptr, DL, AC, CxtI, DT); in computeOverflowForSignedAdd()