Lines Matching defs:AP2
981 /// Handle "(icmp eq/ne (ashr/lshr AP2, A), AP1)" ->
982 /// (icmp eq/ne A, Log2(AP2/AP1)) ->
983 /// (icmp eq/ne A, Log2(AP2) - Log2(AP1)).
986 const APInt &AP2) {
996 if (AP2.isZero())
1001 if (AP2.isAllOnes())
1003 if (AP2.isNegative() != AP1.isNegative())
1005 if (AP2.sgt(AP1))
1012 ConstantInt::get(A->getType(), AP2.logBase2()));
1014 if (AP1 == AP2)
1019 Shift = AP1.countl_one() - AP2.countl_one();
1021 Shift = AP1.countl_zero() - AP2.countl_zero();
1024 if (IsAShr && AP1 == AP2.ashr(Shift)) {
1027 if (AP1.isAllOnes() && !AP2.isPowerOf2())
1030 } else if (AP1 == AP2.lshr(Shift)) {
1041 /// Handle "(icmp eq/ne (shl AP2, A), AP1)" ->
1042 /// (icmp eq/ne A, TrailingZeros(AP1) - TrailingZeros(AP2)).
1045 const APInt &AP2) {
1055 if (AP2.isZero())
1058 unsigned AP2TrailingZeros = AP2.countr_zero();
1063 ConstantInt::get(A->getType(), AP2.getBitWidth() - AP2TrailingZeros));
1065 if (AP1 == AP2)
1071 if (Shift > 0 && AP2.shl(Shift) == AP1)
5293 const APInt *AP1, *AP2;
5297 match(D, m_APIntAllowPoison(AP2)) &&
5298 AP1->isNegative() == AP2->isNegative()) {
5300 APInt AP2Abs = AP2->abs();
5302 APInt Diff = *AP1 - *AP2;
5308 APInt Diff = *AP2 - *AP1;
5311 C, C3, "", Op1HasNUW && Diff.ule(*AP2), Op1HasNSW);
5890 const APInt *AP1, *AP2;
5892 match(Op1, m_OneUse(m_LShr(m_Value(B), m_APIntAllowPoison(AP2))))) ||
5894 match(Op1, m_OneUse(m_AShr(m_Value(B), m_APIntAllowPoison(AP2)))))) {
5895 if (AP1 != AP2)