@@ -1435,7 +1435,7 @@ static void computeKnownBitsFromOperator(const Operator *I,
1435
1435
// inferred hold at original context instruction. TODO: It may be
1436
1436
// correct to use the original context. IF warranted, explore and
1437
1437
// add sufficient tests to cover.
1438
- SimplifyQuery RecQ = Q;
1438
+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
1439
1439
RecQ.CxtI = P;
1440
1440
computeKnownBits (R, DemandedElts, Known2, Depth + 1 , RecQ);
1441
1441
switch (Opcode) {
@@ -1468,7 +1468,7 @@ static void computeKnownBitsFromOperator(const Operator *I,
1468
1468
// phi. This is important because that is where the value is actually
1469
1469
// "evaluated" even though it is used later somewhere else. (see also
1470
1470
// D69571).
1471
- SimplifyQuery RecQ = Q;
1471
+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
1472
1472
1473
1473
unsigned OpNum = P->getOperand (0 ) == R ? 0 : 1 ;
1474
1474
Instruction *RInst = P->getIncomingBlock (OpNum)->getTerminator ();
@@ -1546,7 +1546,7 @@ static void computeKnownBitsFromOperator(const Operator *I,
1546
1546
// phi. This is important because that is where the value is actually
1547
1547
// "evaluated" even though it is used later somewhere else. (see also
1548
1548
// D69571).
1549
- SimplifyQuery RecQ = Q;
1549
+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
1550
1550
RecQ.CxtI = P->getIncomingBlock (u)->getTerminator ();
1551
1551
1552
1552
Known2 = KnownBits (BitWidth);
@@ -2329,7 +2329,7 @@ bool isKnownToBeAPowerOfTwo(const Value *V, bool OrZero, unsigned Depth,
2329
2329
// it is an induction variable where in each step its value is a power of
2330
2330
// two.
2331
2331
auto *PN = cast<PHINode>(I);
2332
- SimplifyQuery RecQ = Q;
2332
+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
2333
2333
2334
2334
// Check if it is an induction variable and always power of two.
2335
2335
if (isPowerOfTwoRecurrence (PN, OrZero, Depth, RecQ))
@@ -2943,7 +2943,7 @@ static bool isKnownNonZeroFromOperator(const Operator *I,
2943
2943
return true ;
2944
2944
2945
2945
// Check if all incoming values are non-zero using recursion.
2946
- SimplifyQuery RecQ = Q;
2946
+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
2947
2947
unsigned NewDepth = std::max (Depth, MaxAnalysisRecursionDepth - 1 );
2948
2948
return llvm::all_of (PN->operands (), [&](const Use &U) {
2949
2949
if (U.get () == PN)
@@ -3509,7 +3509,7 @@ static bool isNonEqualPHIs(const PHINode *PN1, const PHINode *PN2,
3509
3509
if (UsedFullRecursion)
3510
3510
return false ;
3511
3511
3512
- SimplifyQuery RecQ = Q;
3512
+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
3513
3513
RecQ.CxtI = IncomBB->getTerminator ();
3514
3514
if (!isKnownNonEqual (IV1, IV2, DemandedElts, Depth + 1 , RecQ))
3515
3515
return false ;
@@ -4001,7 +4001,7 @@ static unsigned ComputeNumSignBitsImpl(const Value *V,
4001
4001
4002
4002
// Take the minimum of all incoming values. This can't infinitely loop
4003
4003
// because of our depth threshold.
4004
- SimplifyQuery RecQ = Q;
4004
+ SimplifyQuery RecQ = Q. getWithoutCondContext () ;
4005
4005
Tmp = TyBits;
4006
4006
for (unsigned i = 0 , e = NumIncomingValues; i != e; ++i) {
4007
4007
if (Tmp == 1 ) return Tmp;
@@ -5909,10 +5909,10 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
5909
5909
// Recurse, but cap the recursion to two levels, because we don't want
5910
5910
// to waste time spinning around in loops. We need at least depth 2 to
5911
5911
// 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 ()));
5916
5916
5917
5917
if (First) {
5918
5918
Known = KnownSrc;
0 commit comments