reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

include/llvm/Analysis/ValueLattice.h
  203       markConstantRange(ConstantRange(CI->getValue() + 1, CI->getValue()));
include/llvm/IR/ConstantRange.h
  208     if (Upper == Lower + 1)
  216     if (Lower == Upper + 1)
lib/Analysis/BasicAliasAnalysis.cpp
 1301   return GEPBaseOffset.sge(ObjectBaseOffset + (int64_t)ObjectAccessSize);
lib/Analysis/CmpInstAnalysis.cpp
  115     if (!(*C + 1).isPowerOf2())
  122     if (!(*C + 1).isPowerOf2())
lib/Analysis/DependenceAnalysis.cpp
 1460     return Q + 1;
 1597     TL = maxAPInt(TL, ceilingOfQuotient(X - Y + 1, TMUL));
 1601     TU = minAPInt(TU, floorOfQuotient(X - Y + 1, TMUL));
 1640     TL = maxAPInt(TL, ceilingOfQuotient(Y - X + 1, TMUL));
 1644     TU = minAPInt(TU, floorOfQuotient(Y - X + 1, TMUL));
lib/Analysis/IVDescriptors.cpp
   99     int32_t Bits = (*M + 1).exactLogBase2();
lib/Analysis/MemoryBuiltins.cpp
  684         Size = MaxSize + 1;
lib/Analysis/ScalarEvolution.cpp
 5564                         APInt::getMaxValue(BitWidth).lshr(TZ).shl(TZ) + 1);
 5568           APInt::getSignedMaxValue(BitWidth).ashr(TZ).shl(TZ) + 1);
 5713       if (Known.One != ~Known.Zero + 1)
 5716                 ConstantRange(Known.One, ~Known.Zero + 1), RangeType);
 5724                           APInt::getSignedMaxValue(BitWidth).ashr(NS - 1) + 1),
 8997         RHS = getConstant(RA + 1);
 9009         RHS = getConstant(RA + 1);
 9807       APInt SharperMin = Min + 1;
lib/Analysis/ValueTracking.cpp
 5433           Upper = APInt::getSignedMaxValue(Width) + *C + 1;
 5437           Upper = APInt::getSignedMaxValue(Width) + 1;
 5446       Upper = *C + 1;
 5459       Upper = APInt::getSignedMaxValue(Width).ashr(*C) + 1;
 5467         Upper = C->ashr(ShiftAmount) + 1;
 5471         Upper = *C + 1;
 5479       Upper = APInt::getAllOnesValue(Width).lshr(*C) + 1;
 5486       Upper = *C + 1;
 5495         Upper = Lower.shl(Lower.countLeadingZeros()) + 1;
 5501           Upper = *C + 1;
 5506           Upper = C->shl(ShiftAmount) + 1;
 5519         Lower = IntMin + 1;
 5520         Upper = IntMax + 1;
 5528         Upper = Upper + 1;
 5535         Upper = Lower.lshr(1) + 1;
 5538         Upper = C->abs() + 1;
 5539         Lower = (-Upper) + 1;
 5547       Upper = APInt::getMaxValue(Width).udiv(*C) + 1;
 5550       Upper = *C + 1;
 5558       Lower = (-Upper) + 1;
 5590         Upper = APInt::getSignedMaxValue(Width) + *C + 1;
 5594         Upper = APInt::getSignedMaxValue(Width) + 1;
 5601       Upper = *C + 1;
 5604       Upper = APInt::getMaxValue(Width) - *C + 1;
 5611         Upper = *C - APInt::getSignedMinValue(Width) + 1;
 5615         Upper = APInt::getSignedMaxValue(Width) + 1;
 5621         Upper = APInt::getSignedMaxValue(Width) + 1;
 5625         Upper = APInt::getSignedMaxValue(Width) - *C + 1;
 5650       Upper = APInt::getSignedMaxValue(BitWidth) + 1;
 5652       Upper = APInt::getSignedMinValue(BitWidth) + 1;
 5669       Upper = *C + 1;
 5676       Upper = *C + 1;
 5680       Upper = APInt::getSignedMaxValue(BitWidth) + 1;
lib/CodeGen/CodeGenPrepare.cpp
 1514     if ((Cimm & (Cimm + 1)).getBoolValue())
lib/CodeGen/GlobalISel/LegalizerHelper.cpp
 3075           NVT, InL, MIRBuilder.buildConstant(AmtTy, -Amt + NVTBits));
 3093           NVT, InH, MIRBuilder.buildConstant(AmtTy, -Amt + NVTBits));
 3116           NVT, InH, MIRBuilder.buildConstant(AmtTy, -Amt + NVTBits));
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
 2028   SDValue C1 = IsAdd ? DAG.getConstant(CN->getAPIntValue() + 1, DL, VT) :
 2067   APInt NewC = IsAdd ? C->getAPIntValue() + 1 : C->getAPIntValue() - 1;
 3420     else if ((MulC + 1).isPowerOf2())
 3425           MathOp == ISD::ADD ? (MulC - 1).logBase2() : (MulC + 1).logBase2();
 8276       if (C1Val + 1 == C2Val) {
 8642     if (C1 != C2 + 1)
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
 1860                                    DAG.getConstant(-Amt + NVTBits, DL, ShTy)));
 1880                                    DAG.getConstant(-Amt + NVTBits, DL, ShTy)));
 1904                                  DAG.getConstant(-Amt + NVTBits, DL, ShTy)));
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
10386       (FirstLeft->High->getValue() + 1LL) == Pivot->getValue()) {
10402       W.LT && (FirstRight->High->getValue() + 1ULL) == W.LT->getValue()) {
lib/CodeGen/SelectionDAG/TargetLowering.cpp
 3159           if ((C->getAPIntValue()+1).isPowerOf2()) {
 3527         APInt C = C1 + 1;
 3551         if (C1 == MinVal+1)
 3675           NewC = NewC + 1;
lib/CodeGen/SwitchLoweringUtils.cpp
  394     if (Clusters[I].Low->getValue() != Clusters[I - 1].High->getValue() + 1) {
lib/IR/ConstantRange.cpp
   47     : Lower(std::move(V)), Upper(Lower + 1) {}
   67     return ConstantRange(Known.One, ~Known.Zero + 1);
   74   return ConstantRange(Lower, Upper + 1);
  105     return getNonEmpty(APInt::getMinValue(W), CR.getUnsignedMax() + 1);
  107     return getNonEmpty(APInt::getSignedMinValue(W), CR.getSignedMax() + 1);
  112     return ConstantRange(std::move(UMin) + 1, APInt::getNullValue(W));
  118     return ConstantRange(std::move(SMin) + 1, APInt::getSignedMinValue(W));
  193                              APInt::Rounding::DOWN) + 1);
  221   return ConstantRange(Lower, Upper + 1);
  289                          APInt::getMaxValue(BitWidth).lshr(ShAmtUMax) + 1);
  291                        APInt::getSignedMaxValue(BitWidth).ashr(ShAmtUMax) + 1);
  698                          APInt::getLowBitsSet(DstTySize, SrcTySize-1) + 1);
  875     return getNonEmpty(std::move(NewMin), std::move(NewMax) + 1);
  895     return getNonEmpty(std::move(NewMin), std::move(NewMax) + 1);
  912   APInt NewLower = getLower() - Other.getUpper() + 1;
  948                                             this_max * Other_max + 1);
  973   ConstantRange Result_sext(std::min(L, Compare), std::max(L, Compare) + 1);
  986   APInt NewU = APIntOps::smax(getSignedMax(), Other.getSignedMax()) + 1;
  997   APInt NewU = APIntOps::umax(getUnsignedMax(), Other.getUnsignedMax()) + 1;
 1008   APInt NewU = APIntOps::smin(getSignedMax(), Other.getSignedMax()) + 1;
 1019   APInt NewU = APIntOps::umin(getUnsignedMax(), Other.getUnsignedMax()) + 1;
 1040   APInt Upper = getUnsignedMax().udiv(RHS_umin) + 1;
 1061                            (PosL.Upper - 1).sdiv(PosR.Lower) + 1);
 1084             ConstantRange(Lo, NegL.Lower.sdiv(AdjNegRUpper - 1) + 1));
 1089       if (NegL.Upper != SignedMin + 1) {
 1091         if (Upper == SignedMin + 1)
 1096           AdjNegLLower = NegL.Lower + 1;
 1100                           AdjNegLLower.sdiv(NegR.Upper - 1) + 1));
 1104           ConstantRange(std::move(Lo), NegL.Lower.sdiv(NegR.Upper - 1) + 1));
 1112                            PosL.Lower.sdiv(NegR.Lower) + 1);
 1118                       (NegL.Upper - 1).sdiv(PosR.Upper - 1) + 1));
 1138   APInt Upper = APIntOps::umin(getUnsignedMax(), RHS.getUnsignedMax() - 1) + 1;
 1165     APInt Upper = APIntOps::umin(MaxLHS, MaxAbsRHS - 1) + 1;
 1174     APInt Lower = APIntOps::umax(MinLHS, -MaxAbsRHS + 1);
 1179   APInt Lower = APIntOps::umax(MinLHS, -MaxAbsRHS + 1);
 1180   APInt Upper = APIntOps::umin(MaxLHS, MaxAbsRHS - 1) + 1;
 1192   return getNonEmpty(APInt::getNullValue(getBitWidth()), std::move(umin) + 1);
 1228   return ConstantRange(std::move(min), std::move(max) + 1);
 1236   APInt max = getUnsignedMax().lshr(Other.getUnsignedMin()) + 1;
 1252   APInt PosMax = getSignedMax().ashr(Other.getUnsignedMin()) + 1;
 1266   APInt NegMax = getSignedMax().ashr(Other.getUnsignedMax()) + 1;
 1297   APInt NewU = getUnsignedMax().uadd_sat(Other.getUnsignedMax()) + 1;
 1306   APInt NewU = getSignedMax().sadd_sat(Other.getSignedMax()) + 1;
 1315   APInt NewU = getUnsignedMax().usub_sat(Other.getUnsignedMin()) + 1;
 1324   APInt NewU = getSignedMax().ssub_sat(Other.getSignedMin()) + 1;
 1346       Lo = APIntOps::umin(Lower, -Upper + 1);
 1349     return ConstantRange(Lo, APInt::getSignedMinValue(getBitWidth()) + 1);
 1360     return ConstantRange(-SMax, -SMin + 1);
 1364                        APIntOps::umax(-SMin, SMax) + 1);
lib/IR/Metadata.cpp
 1460           OffsetConst->getType(), OffsetConst->getValue() + Offset));
lib/Support/APInt.cpp
 1137   APInt nextSquare((x_old + 1) * (x_old +1));
 1137   APInt nextSquare((x_old + 1) * (x_old +1));
 1145   return x_old + 1;
 1221       q1 = q1 + 1;
 1227       q2 = q2 + 1;
 1233   mag.m = q2 + 1;
 1264       q1 = q1 + q1 + 1;  // update q1
 1271     if ((r2 + 1).uge(d - r2)) {
 1273       q2 = q2+q2 + 1;     // update q2
 1274       r2 = r2+r2 + 1 - d; // update r2
 1279       r2 = r2+r2 + 1; // update r2
 1284   magu.m = q2 + 1; // resulting magic number
 2804     return Quo + 1;
 2831     return Quo + 1;
 2990     APInt::sdivrem(-B - (SQ+InexactSQ), TwoA, X, Rem);
lib/Support/KnownBits.cpp
   24   APInt PossibleSumZero = ~LHS.Zero + ~RHS.Zero + !CarryZero;
   25   APInt PossibleSumOne = LHS.One + RHS.One + CarryOne;
lib/Target/AArch64/AArch64ISelLowering.cpp
 9429     APInt CVPlus1 = ConstValue + 1;
 9441     APInt CVNegPlus1 = -ConstValue + 1;
lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
   97   int64_t Offset = (SignedOffset.sext(64) + 4 + Addr).getSExtValue();
   97   int64_t Offset = (SignedOffset.sext(64) + 4 + Addr).getSExtValue();
lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.cpp
  126     Target = (SignedOffset.sext(64) + Addr + Size).getZExtValue();
  126     Target = (SignedOffset.sext(64) + Addr + Size).getZExtValue();
lib/Target/Mips/MipsSEISelDAGToDAG.cpp
  669     if (ImmValue == ~(~ImmValue & ~(~ImmValue + 1))) {
  702     if (ImmValue == (ImmValue & ~(ImmValue + 1))) {
lib/Target/Mips/MipsSEISelLowering.cpp
  502     int32_t Log2IfPositive = (Mask->getAPIntValue() + 1).exactLogBase2();
lib/Target/PowerPC/PPCISelLowering.cpp
15383   } else if ((MulAmtAbs + 1).isPowerOf2()) {
15393                     DAG.getConstant((MulAmtAbs + 1).logBase2(), DL, VT));
lib/Target/X86/X86ISelLowering.cpp
 4948   return (MulC + 1).isPowerOf2() || (MulC - 1).isPowerOf2() ||
 4949          (1 - MulC).isPowerOf2() || (-(MulC + 1)).isPowerOf2();
20563     NewVecC.push_back(DAG.getConstant(EltC + (IsInc ? 1 : -1), DL, EltVT));
37631       if (FalseC->getAPIntValue()+1 == TrueC->getAPIntValue()) {
44225                          DAG.getConstant(C->getAPIntValue() + 1, SDLoc(N), VT));
lib/Transforms/InstCombine/InstCombineAddSub.cpp
  818       if (match(Y, m_And(m_Value(Z), m_APInt(C2))) && *C1 == (*C2 + 1)) {
  981   if (match(E, m_And(m_Value(Op), m_APInt(AI))) && (*AI + 1).isPowerOf2()) {
  982     C = *AI + 1;
 1256       if (LHS->hasOneUse() && (XorRHS->getValue()+1).isPowerOf2()) {
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
 1010     APInt OtherHighestBit = (~UnsetBitsMask) + 1U;
 1302         return insertRangeTest(LHS0, LHSC->getValue() + 1, RHSC->getValue(),
 1311         return insertRangeTest(LHS0, LHSC->getValue() + 1, RHSC->getValue(),
 1325       if (RHSC->getValue() == (LHSC->getValue() + 1))
 1329         return insertRangeTest(LHS0, LHSC->getValue() + 1, RHSC->getValue(),
 1333       return insertRangeTest(LHS0, LHSC->getValue() + 1, RHSC->getValue(),
 1343       if (RHSC->getValue() == (LHSC->getValue() + 1))
 1347         return insertRangeTest(LHS0, LHSC->getValue() + 1, RHSC->getValue(),
 1351       return insertRangeTest(LHS0, LHSC->getValue() + 1, RHSC->getValue(), true,
 2395         return insertRangeTest(LHS0, LHSC->getValue() + 1, RHSC->getValue() + 1,
 2395         return insertRangeTest(LHS0, LHSC->getValue() + 1, RHSC->getValue() + 1,
 2402         return insertRangeTest(LHS0, LHSC->getValue() + 1, RHSC->getValue() + 1,
 2402         return insertRangeTest(LHS0, LHSC->getValue() + 1, RHSC->getValue() + 1,
 2420       return insertRangeTest(LHS0, LHSC->getValue(), RHSC->getValue() + 1,
 2437       return insertRangeTest(LHS0, LHSC->getValue(), RHSC->getValue() + 1, true,
lib/Transforms/InstCombine/InstCombineCompares.cpp
 1613     if (*XorC == ~C && (C + 1).isPowerOf2())
 1616     if (*XorC == C && (C + 1).isPowerOf2())
 1748     if ((~(*C2) + 1).isPowerOf2()) {
 1895     if ((C + 1).isPowerOf2()) {
 2064       APInt ShiftedC = (C - 1).ashr(*ShiftAmt) + 1;
 2094       APInt ShiftedC = (C - 1).lshr(*ShiftAmt) + 1;
 2124     if ((C + 1).isPowerOf2() &&
 2206       APInt ShiftedC = (C + 1).shl(ShAmtVal) - 1;
 2207       if (!C.isMaxSignedValue() && !(C + 1).shl(ShAmtVal).isMinSignedValue() &&
 2208           (ShiftedC + 1).ashr(ShAmtVal) == (C + 1))
 2208           (ShiftedC + 1).ashr(ShAmtVal) == (C + 1))
 2221       APInt ShiftedC = (C + 1).shl(ShAmtVal) - 1;
 2222       if ((ShiftedC + 1).lshr(ShAmtVal) == (C + 1))
 2222       if ((ShiftedC + 1).lshr(ShAmtVal) == (C + 1))
 2310                         ConstantInt::get(Y->getType(), C2->udiv(C + 1)));
 2405       HiBound = Prod + 1;
 2417       LoBound = RangeSize + 1;
 2425       HiBound = Prod + 1;
 2549   if (Pred == ICmpInst::ICMP_UGT && (C + 1).isPowerOf2() && (*C2 & C) == C)
 2615   if (Pred == ICmpInst::ICMP_UGT && (C + 1).isPowerOf2() && (*C2 & C) == 0)
 4201     APInt Pow2 = Cst1->getValue() + 1;
 4616       const APInt &CVal = CI->getValue() + 1;
 5040       if (*CmpC == Op0Min + 1)
 5064                             ConstantInt::get(Op1->getType(), *CmpC + 1));
 5082       if (*CmpC == Op0Min + 1) // A <s C -> A == C-1 if min(A)+1 == C
 5099                             ConstantInt::get(Op1->getType(), *CmpC + 1));
lib/Transforms/InstCombine/InstCombineSelect.cpp
  915     AdjustedRHS = ConstantInt::get(CmpRHS->getType(), *CmpC + 1);
 2036   if (!(*MaxValue + 1).isPowerOf2() || -*MinValue != *MaxValue + 1)
 2036   if (!(*MaxValue + 1).isPowerOf2() || -*MinValue != *MaxValue + 1)
 2039   unsigned NewBitWidth = (*MaxValue + 1).logBase2() + 1;
lib/Transforms/Scalar/LoopStrengthReduce.cpp
 4253               if ((C->getAPInt() + NewF.BaseOffset)
 4256                   (C->getAPInt() + NewF.BaseOffset).countTrailingZeros() >=
lib/Transforms/Scalar/MergeICmps.cpp
  425            First.Lhs().Offset + First.SizeBits() / 8 == Second.Lhs().Offset &&
  426            First.Rhs().Offset + First.SizeBits() / 8 == Second.Rhs().Offset;
lib/Transforms/Scalar/Reassociate.cpp
  356     APInt Threshold = CM + Bitwidth;
lib/Transforms/Utils/LowerSwitch.cpp
  511     DefaultIsUnreachableFromSwitch = (Min + (NumSimpleCases - 1) == Max);
lib/Transforms/Utils/SimplifyCFG.cpp
 4318     if (Cases[I - 1]->getValue() != Cases[I]->getValue() + 1)
tools/clang/lib/CodeGen/CGBuiltin.cpp
 7094         -cast<llvm::ConstantInt>(CacheLevel)->getValue() + 3);
tools/clang/lib/Lex/LiteralSupport.cpp
 1376       LitVal = LitVal + (codepoint_buffer[i] & 0xFF);
tools/clang/lib/Sema/SemaExpr.cpp
 3545     if (Literal.isFract && Val == MaxVal + 1 && !ValIsZero)
 9847       static_cast<llvm::APInt&>(Right) + Left.getMinSignedBits();
tools/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp
  223     maxStep = (BoundNum - InitNum + 1).abs().getZExtValue();
unittests/ADT/APIntTest.cpp
   29   APInt One = APInt::getNullValue(65) + 1;
  408   auto big = u64 + 1;
  585   EXPECT_EQ(A2 | 2, A2 + 2);
  586   EXPECT_EQ(A2 | UINT64_MAX, A2 - N + UINT64_MAX);
  591   EXPECT_EQ(A2 ^ 7, A2 + 5);
  592   EXPECT_EQ(A2 ^ UINT64_MAX, A2 - N + ~N);
  632     APInt AddLK = One + 1;
  639     APInt AddRK = getRValue("1", RawDataL) + 1;
  670     APInt AddLK = AllOnes + 2;
  677     APInt AddRK = getRValue("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", RawDataL) + 2;
 2574           EXPECT_TRUE(((Quo + 1).sext(16) * B.sext(16)).ugt(A));
unittests/IR/ConstantRangeTest.cpp
   90     ConstantRange Exact = ConstantRange::getNonEmpty(Min, Max + 1);
  127     ConstantRange Exact = ConstantRange::getNonEmpty(Min, Max + 1);
  488           if (Lower1 == Upper1 + 1) {
  493             ConstantRange Expected(Lower1, Upper1 + 1);
  505           if (Lower1 != Upper2 + 1)
  506             Variant1 = ConstantRange(Lower1, Upper2 + 1);
  507           if (Lower2 != Upper1 + 1)
  508             Variant2 = ConstantRange(Lower2, Upper1 + 1);
  514           Variant1 = ConstantRange(Lower2, Upper1 + 1);
  515           Variant2 = ConstantRange(Lower3, Upper2 + 1);
  673       ConstantRange Exact = ConstantRange::getNonEmpty(Min, Max + 1);
  707       ConstantRange Exact = ConstantRange::getNonEmpty(Min, Max + 1);
  752               ConstantRange::getNonEmpty(SMin, SMax + 1)
  753                   .intersectWith(ConstantRange::getNonEmpty(UMin, UMax + 1));
 1110     ConstantRange Envelope = ConstantRange::getNonEmpty(SMin, SMax + 1);
 1130     ConstantRange Wrapped = ConstantRange::getNonEmpty(WMin, WMax + 1);
 1177   EXPECT_EQ(Full.srem(Full), ConstantRange(APInt::getSignedMinValue(16) + 1,
 1265       ConstantRange(APInt(16, 0xfff << 0x1), APInt(16, 0x7fff << 0x1) + 1));
 1480             ConstantRange(APInt::getSignedMinValue(32) + 5,
 1484             ConstantRange(APInt::getMinValue(32) + 5, APInt::getMinValue(32)));
 1489             ConstantRange(APInt::getSignedMinValue(32) + 5,
 1506             ConstantRange(APInt::getSignedMinValue(32) + 1,
 1513             ConstantRange(APInt::getSignedMinValue(32) + 1,
 1530             ConstantRange(APInt::getSignedMinValue(32) + 1,
 1534             ConstantRange(APInt::getMinValue(32) + 1, APInt::getMinValue(32)));
 1536   ConstantRange OneLessThanBitWidth(APInt(32, 0), APInt(32, 31) + 1);
 1537   ConstantRange UpToBitWidth(APInt(32, 0), APInt(32, 32) + 1);
 1548             ConstantRange(APInt(32, 0), APInt(32, 1) + 1));
 1551             ConstantRange(APInt(32, -1), APInt(32, 0) + 1));
 1564   ConstantRange IllegalShAmt(APInt(32, 32), APInt(32, 0) + 1);
 1574           Instruction::Shl, ConstantRange(APInt(32, -32), APInt(32, 16) + 1),
 1577           Instruction::Shl, ConstantRange(APInt(32, 0), APInt(32, 16) + 1),
 1581           Instruction::Shl, ConstantRange(APInt(32, -32), APInt(32, 16) + 1),
 1584           Instruction::Shl, ConstantRange(APInt(32, 0), APInt(32, 16) + 1),
 1589                 ConstantRange(APInt(32, -32), APInt(32, 16) + 1),
 1591             ConstantRange(APInt(32, 0), APInt(32, 65535) + 1));
 1594                 ConstantRange(APInt(32, -32), APInt(32, 16) + 1),
 1596             ConstantRange(APInt(32, -32768), APInt(32, 32767) + 1));
 2124       ConstantRange UnsignedCR(MinUnsigned, MaxUnsigned + 1);
 2125       ConstantRange SignedCR(MinSigned, MaxSigned + 1);
 2220     ConstantRange Exact = ConstantRange::getNonEmpty(Min, Max + 1);