@@ -727,17 +727,16 @@ static void computeKnownBitsFromCmp(const Value *V, CmpInst::Predicate Pred,
727727 // For those bits in C that are known, we can propagate them to known
728728 // bits in V shifted to the right by ShAmt.
729729 KnownBits RHSKnown = KnownBits::makeConstant (*C);
730- RHSKnown.Zero .lshrInPlace (ShAmt);
731- RHSKnown.One .lshrInPlace (ShAmt);
730+ RHSKnown >>= ShAmt;
732731 Known = Known.unionWith (RHSKnown);
733732 // assume(V >> ShAmt = C)
734733 } else if (match (LHS, m_Shr (m_V, m_ConstantInt (ShAmt))) &&
735734 ShAmt < BitWidth) {
736- KnownBits RHSKnown = KnownBits::makeConstant (*C);
737735 // For those bits in RHS that are known, we can propagate them to known
738736 // bits in V shifted to the right by C.
739- Known.Zero |= RHSKnown.Zero << ShAmt;
740- Known.One |= RHSKnown.One << ShAmt;
737+ KnownBits RHSKnown = KnownBits::makeConstant (*C);
738+ RHSKnown <<= ShAmt;
739+ Known = Known.unionWith (RHSKnown);
741740 }
742741 break ;
743742 case ICmpInst::ICMP_NE: {
@@ -1890,10 +1889,9 @@ static void computeKnownBitsFromOperator(const Operator *I,
18901889 computeKnownBits (I->getOperand (0 ), DemandedElts, Known2, Q, Depth + 1 );
18911890 computeKnownBits (I->getOperand (1 ), DemandedElts, Known3, Q, Depth + 1 );
18921891
1893- Known.Zero =
1894- Known2.Zero .shl (ShiftAmt) | Known3.Zero .lshr (BitWidth - ShiftAmt);
1895- Known.One =
1896- Known2.One .shl (ShiftAmt) | Known3.One .lshr (BitWidth - ShiftAmt);
1892+ Known2 <<= ShiftAmt;
1893+ Known3 >>= BitWidth - ShiftAmt;
1894+ Known = Known2.unionWith (Known3);
18971895 break ;
18981896 }
18991897 case Intrinsic::uadd_sat:
0 commit comments