@@ -1435,7 +1435,7 @@ static void computeKnownBitsFromOperator(const Operator *I,
14351435 // inferred hold at original context instruction. TODO: It may be
14361436 // correct to use the original context. IF warranted, explore and
14371437 // add sufficient tests to cover.
1438- SimplifyQuery RecQ = Q;
1438+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
14391439 RecQ.CxtI = P;
14401440 computeKnownBits (R, DemandedElts, Known2, Depth + 1 , RecQ);
14411441 switch (Opcode) {
@@ -1468,7 +1468,7 @@ static void computeKnownBitsFromOperator(const Operator *I,
14681468 // phi. This is important because that is where the value is actually
14691469 // "evaluated" even though it is used later somewhere else. (see also
14701470 // D69571).
1471- SimplifyQuery RecQ = Q;
1471+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
14721472
14731473 unsigned OpNum = P->getOperand (0 ) == R ? 0 : 1 ;
14741474 Instruction *RInst = P->getIncomingBlock (OpNum)->getTerminator ();
@@ -1546,7 +1546,7 @@ static void computeKnownBitsFromOperator(const Operator *I,
15461546 // phi. This is important because that is where the value is actually
15471547 // "evaluated" even though it is used later somewhere else. (see also
15481548 // D69571).
1549- SimplifyQuery RecQ = Q;
1549+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
15501550 RecQ.CxtI = P->getIncomingBlock (u)->getTerminator ();
15511551
15521552 Known2 = KnownBits (BitWidth);
@@ -2329,7 +2329,7 @@ bool isKnownToBeAPowerOfTwo(const Value *V, bool OrZero, unsigned Depth,
23292329 // it is an induction variable where in each step its value is a power of
23302330 // two.
23312331 auto *PN = cast<PHINode>(I);
2332- SimplifyQuery RecQ = Q;
2332+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
23332333
23342334 // Check if it is an induction variable and always power of two.
23352335 if (isPowerOfTwoRecurrence (PN, OrZero, Depth, RecQ))
@@ -2943,7 +2943,7 @@ static bool isKnownNonZeroFromOperator(const Operator *I,
29432943 return true ;
29442944
29452945 // Check if all incoming values are non-zero using recursion.
2946- SimplifyQuery RecQ = Q;
2946+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
29472947 unsigned NewDepth = std::max (Depth, MaxAnalysisRecursionDepth - 1 );
29482948 return llvm::all_of (PN->operands (), [&](const Use &U) {
29492949 if (U.get () == PN)
@@ -3509,7 +3509,7 @@ static bool isNonEqualPHIs(const PHINode *PN1, const PHINode *PN2,
35093509 if (UsedFullRecursion)
35103510 return false ;
35113511
3512- SimplifyQuery RecQ = Q;
3512+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
35133513 RecQ.CxtI = IncomBB->getTerminator ();
35143514 if (!isKnownNonEqual (IV1, IV2, DemandedElts, Depth + 1 , RecQ))
35153515 return false ;
@@ -4001,7 +4001,7 @@ static unsigned ComputeNumSignBitsImpl(const Value *V,
40014001
40024002 // Take the minimum of all incoming values. This can't infinitely loop
40034003 // because of our depth threshold.
4004- SimplifyQuery RecQ = Q;
4004+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
40054005 Tmp = TyBits;
40064006 for (unsigned i = 0 , e = NumIncomingValues; i != e; ++i) {
40074007 if (Tmp == 1 ) return Tmp;
@@ -5909,10 +5909,10 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
59095909 // Recurse, but cap the recursion to two levels, because we don't want
59105910 // to waste time spinning around in loops. We need at least depth 2 to
59115911 // detect known sign bits.
5912- computeKnownFPClass (
5913- IncValue, DemandedElts, InterestedClasses, KnownSrc ,
5914- PhiRecursionLimit,
5915- Q. getWithInstruction ( P->getIncomingBlock (U)->getTerminator ()));
5912+ computeKnownFPClass (IncValue, DemandedElts, InterestedClasses, KnownSrc,
5913+ PhiRecursionLimit ,
5914+ Q. getWithoutCondContext (). getWithInstruction (
5915+ P->getIncomingBlock (U)->getTerminator ()));
59165916
59175917 if (First) {
59185918 Known = KnownSrc;
0 commit comments