@@ -630,16 +630,6 @@ static void computeKnownBitsFromCmp(const Value *V, const ICmpInst *Cmp,
630
630
KnownBits &Known, unsigned Depth,
631
631
const SimplifyQuery &Q) {
632
632
unsigned BitWidth = Known.getBitWidth ();
633
- // We are attempting to compute known bits for the operands of an assume.
634
- // Do not try to use other assumptions for those recursive calls because
635
- // that can lead to mutual recursion and a compile-time explosion.
636
- // An example of the mutual recursion: computeKnownBits can call
637
- // isKnownNonZero which calls computeKnownBitsFromAssume (this function)
638
- // and so on.
639
- SimplifyQuery QueryNoAC = Q;
640
- QueryNoAC.AC = nullptr ;
641
-
642
- // Note that ptrtoint may change the bitwidth.
643
633
auto m_V =
644
634
m_CombineOr (m_Specific (V), m_PtrToIntSameSize (Q.DL , m_Specific (V)));
645
635
@@ -696,15 +686,10 @@ static void computeKnownBitsFromCmp(const Value *V, const ICmpInst *Cmp,
696
686
break ;
697
687
}
698
688
default :
699
- Value *A;
700
689
const APInt *Offset = nullptr ;
701
690
if (match (Cmp, m_ICmp (Pred, m_CombineOr (m_V, m_Add (m_V, m_APInt (Offset))),
702
- m_Value (A)))) {
703
- KnownBits RHSKnown = computeKnownBits (A, Depth + 1 , QueryNoAC);
704
- ConstantRange RHSRange =
705
- ConstantRange::fromKnownBits (RHSKnown, Cmp->isSigned ());
706
- ConstantRange LHSRange =
707
- ConstantRange::makeAllowedICmpRegion (Pred, RHSRange);
691
+ m_APInt (C)))) {
692
+ ConstantRange LHSRange = ConstantRange::makeAllowedICmpRegion (Pred, *C);
708
693
if (Offset)
709
694
LHSRange = LHSRange.sub (*Offset);
710
695
Known = Known.unionWith (LHSRange.toKnownBits ());
0 commit comments