| /llvm-project-15.0.7/llvm/unittests/ADT/ |
| H A D | APIntTest.cpp | 21 APInt Zero = APInt(); in TEST() 29 APInt One = APInt::getZero(65) + 1; in TEST() 910 void testDiv(APInt a, APInt b, APInt c) { in testDiv() 1179 APInt AP_10 = APInt(8, 10); in TEST() 1180 APInt AP_42 = APInt(8, 42); in TEST() 1476 EXPECT_EQ(APInt(32, 1), APInt(32, 1).rotl(APInt(1, 0))); in TEST() 1477 EXPECT_EQ(APInt(32, 2), APInt(32, 1).rotl(APInt(1, 1))); in TEST() 1484 EXPECT_EQ(APInt(7, 24), APInt(7, 3).rotl(APInt(7, 3))); in TEST() 1520 EXPECT_EQ(APInt(7, 48), APInt(7, 3).rotr(APInt(7, 3))); in TEST() 2806 APInt N1 = APInt(Bits, A), N2 = APInt(Bits, B); in TEST() [all …]
|
| H A D | APSIntTest.cpp | 27 APInt Wide(256, 0); in TEST() 36 Wide = APInt(128, 1); in TEST() 186 APSInt False(APInt(1, 0), false); in TEST() 187 APSInt True(APInt(1, 1), false); in TEST() 188 APSInt CharMin(APInt(8, 0), false); in TEST() 229 APSInt False(APInt(1, 0)); in TEST() 230 APSInt True(APInt(1, 1)); in TEST() 231 APSInt CharMin(APInt(8, 0)); in TEST() 232 APSInt CharSmall(APInt(8, 0x13)); in TEST() 235 APSInt CharLarge(APInt(8, 0xd9)); in TEST() [all …]
|
| H A D | StringExtrasTest.cpp | 243 EXPECT_EQ(toString(APInt(8, 0), 2, true, true), "0b0"); in TEST() 244 EXPECT_EQ(toString(APInt(8, 0), 8, true, true), "00"); in TEST() 245 EXPECT_EQ(toString(APInt(8, 0), 10, true, true), "0"); in TEST() 246 EXPECT_EQ(toString(APInt(8, 0), 16, true, true), "0x0"); in TEST() 247 EXPECT_EQ(toString(APInt(8, 0), 36, true, false), "0"); in TEST() 267 EXPECT_EQ(toString(APSInt(APInt(8, 0), false), 2), "0"); in TEST() 268 EXPECT_EQ(toString(APSInt(APInt(8, 0), false), 8), "0"); in TEST() 269 EXPECT_EQ(toString(APSInt(APInt(8, 0), false), 10), "0"); in TEST() 270 EXPECT_EQ(toString(APSInt(APInt(8, 0), false), 16), "0"); in TEST() 279 EXPECT_EQ(toString(APSInt(APInt(8, 255), isUnsigned), 2), "-1"); in TEST() [all …]
|
| /llvm-project-15.0.7/llvm/include/llvm/ADT/ |
| H A D | APInt.h | 38 inline APInt operator-(APInt); 2002 inline APInt operator&(APInt a, const APInt &b) { 2007 inline APInt operator&(const APInt &a, APInt &&b) { 2022 inline APInt operator|(APInt a, const APInt &b) { 2042 inline APInt operator^(APInt a, const APInt &b) { 2072 inline APInt operator+(APInt a, const APInt &b) { 2092 inline APInt operator-(APInt a, const APInt &b) { 2152 APInt GreatestCommonDivisor(APInt A, APInt B); 2193 APInt RoundingUDiv(const APInt &A, const APInt &B, APInt::Rounding RM); 2196 APInt RoundingSDiv(const APInt &A, const APInt &B, APInt::Rounding RM); [all …]
|
| H A D | APSInt.h | 64 APSInt &operator=(APInt RHS) { 66 APInt::operator=(std::move(RHS)); 72 APInt::operator=(RHS); 86 using APInt::toString; 203 ++(static_cast<APInt&>(*this)); 207 --(static_cast<APInt&>(*this)); 221 static_cast<APInt&>(*this) += RHS; 226 static_cast<APInt&>(*this) -= RHS; 231 static_cast<APInt&>(*this) *= RHS; 236 static_cast<APInt&>(*this) &= RHS; [all …]
|
| /llvm-project-15.0.7/llvm/unittests/IR/ |
| H A D | ConstantRangeTest.cpp | 718 [](const APInt &N1, const APInt &N2) { in TEST_F() 776 [](const APInt &N1, const APInt &N2) -> Optional<APInt> { in TEST_F() 830 [](const APInt &N1, const APInt &N2) -> Optional<APInt> { in TEST_F() 870 [](const APInt &N1, const APInt &N2) -> Optional<APInt> { in TEST_F() 908 [](const APInt &N1, const APInt &N2) { in TEST_F() 919 [](const APInt &N1, const APInt &N2) -> Optional<APInt> { in TEST_F() 932 [](const APInt &N1, const APInt &N2) -> Optional<APInt> { in TEST_F() 945 [](const APInt &N1, const APInt &N2) -> Optional<APInt> { in TEST_F() 1249 [](const APInt &N1, const APInt &N2) -> Optional<APInt> { in TEST_F() 1325 [](const APInt &N1, const APInt &N2) -> Optional<APInt> { in TEST_F() [all …]
|
| H A D | DemandedBitsTest.cpp | 25 APInt AOut(Bits, AOut_); in TestBinOpExhaustive() 26 APInt AB1 = PropagateFn(0, AOut, Known1, Known2); in TestBinOpExhaustive() 27 APInt AB2 = PropagateFn(1, AOut, Known1, Known2); in TestBinOpExhaustive() 39 APInt AB1R = PropagateFn(0, AOut, Known1Redacted, Known2Redacted); in TestBinOpExhaustive() 40 APInt AB2R = PropagateFn(1, AOut, Known1Redacted, Known2Redacted); in TestBinOpExhaustive() 44 ForeachNumInKnownBits(Known1, [&](APInt Value1) { in TestBinOpExhaustive() 45 ForeachNumInKnownBits(Known2, [&](APInt Value2) { in TestBinOpExhaustive() 46 APInt ReferenceResult = EvalFn((Value1 & AB1), (Value2 & AB2)); in TestBinOpExhaustive() 47 APInt Result = EvalFn(Value1, Value2); in TestBinOpExhaustive() 58 [](APInt N1, APInt N2) -> APInt { return N1 + N2; }); in TEST() [all …]
|
| /llvm-project-15.0.7/mlir/lib/Dialect/Arithmetic/IR/ |
| H A D | InferIntRangeInterfaceImpls.cpp | 22 function_ref<Optional<APInt>(const APInt &, const APInt &)>; 81 ConstArithFn uadd = [](const APInt &a, const APInt &b) -> Optional<APInt> { in inferResultRanges() 86 ConstArithFn sadd = [](const APInt &a, const APInt &b) -> Optional<APInt> { in inferResultRanges() 107 ConstArithFn usub = [](const APInt &a, const APInt &b) -> Optional<APInt> { in inferResultRanges() 160 const APInt &lhs, const APInt &rhs, const APInt &result)>; 291 APInt umin = APInt::getZero(width); in inferResultRanges() 359 static std::tuple<APInt, APInt> 374 auto andi = [](const APInt &a, const APInt &b) -> Optional<APInt> { in inferResultRanges() 391 auto ori = [](const APInt &a, const APInt &b) -> Optional<APInt> { in inferResultRanges() 408 auto xori = [](const APInt &a, const APInt &b) -> Optional<APInt> { in inferResultRanges() [all …]
|
| H A D | ArithmeticOps.cpp | 310 static APInt signedCeilNonnegInputs(const APInt &a, const APInt &b, in signedCeilNonnegInputs() 365 APInt zero = APInt::getZero(bits); in fold() 414 APInt zero = APInt::getZero(bits); in fold() 497 APInt intValue; in fold() 616 APInt intValue; in fold() 644 APInt intValue; in fold() 690 APInt intValue; in fold() 718 APInt intValue; in fold() 1911 operands, [&](const APInt &a, const APInt &b) { in fold() 1926 operands, [&](const APInt &a, const APInt &b) { in fold() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Support/ |
| H A D | APInt.cpp | 188 APInt& APInt::operator+=(const APInt& RHS) { in operator +=() 208 APInt& APInt::operator-=(const APInt& RHS) { in operator -=() 225 APInt APInt::operator*(const APInt& RHS) const { in operator *() 254 APInt &APInt::operator*=(const APInt &RHS) { in operator *=() 1571 APInt APInt::udiv(const APInt &RHS) const { in udiv() 1642 APInt APInt::sdiv(const APInt &RHS) const { in sdiv() 1664 APInt APInt::urem(const APInt &RHS) const { in urem() 1734 APInt APInt::srem(const APInt &RHS) const { in srem() 2009 APInt APInt::sadd_sat(const APInt &RHS) const { in sadd_sat() 2019 APInt APInt::uadd_sat(const APInt &RHS) const { in uadd_sat() [all …]
|
| H A D | DivisionByConstantInfo.cpp | 21 SignedDivisionByConstantInfo SignedDivisionByConstantInfo::get(const APInt &D) { in get() 23 APInt AD, ANC, Delta, Q1, R1, Q2, R2, T; in get() 24 APInt SignedMin = APInt::getSignedMinValue(D.getBitWidth()); in get() 66 UnsignedDivisionByConstantInfo::get(const APInt &D, unsigned LeadingZeros) { in get() 68 APInt NC, Delta, Q1, R1, Q2, R2; in get() 71 APInt AllOnes = APInt::getAllOnes(D.getBitWidth()).lshr(LeadingZeros); in get() 72 APInt SignedMin = APInt::getSignedMinValue(D.getBitWidth()); in get() 73 APInt SignedMax = APInt::getSignedMaxValue(D.getBitWidth()); in get()
|
| /llvm-project-15.0.7/mlir/unittests/Interfaces/ |
| H A D | InferIntRangeInterfaceTest.cpp | 18 APInt zero = APInt::getZero(64); in TEST() 29 APInt zero = APInt::getZero(64); in TEST() 30 APInt maxInt = APInt::getSignedMaxValue(64); in TEST() 31 APInt minInt = APInt::getSignedMinValue(64); in TEST() 51 APInt zero = APInt::getZero(64); in TEST() 54 APInt intMax = APInt::getSignedMaxValue(64); in TEST() 55 APInt intMin = APInt::getSignedMinValue(64); in TEST() 56 APInt uintMax = APInt::getMaxValue(64); in TEST() 77 APInt zero = APInt::getZero(64); in TEST() 80 APInt intMin = APInt::getSignedMinValue(64); in TEST() [all …]
|
| /llvm-project-15.0.7/mlir/lib/Interfaces/ |
| H A D | InferIntRangeInterface.cpp | 21 const APInt &ConstantIntRanges::umin() const { return uminVal; } in umin() 23 const APInt &ConstantIntRanges::umax() const { return umaxVal; } in umax() 25 const APInt &ConstantIntRanges::smin() const { return sminVal; } in smin() 39 return fromUnsigned(APInt::getZero(bitwidth), APInt::getMaxValue(bitwidth)); in maxRange() 46 ConstantIntRanges ConstantIntRanges::range(const APInt &min, const APInt &max, in range() 56 APInt umin, umax; in fromSigned() 61 umin = APInt::getMinValue(width); in fromSigned() 62 umax = APInt::getMaxValue(width); in fromSigned() 70 APInt smin, smax; in fromUnsigned() 75 smin = APInt::getSignedMinValue(width); in fromUnsigned() [all …]
|
| /llvm-project-15.0.7/llvm/lib/IR/ |
| H A D | ConstantRange.cpp | 50 ConstantRange::ConstantRange(APInt L, APInt U) in ConstantRange() 236 APInt Offset; in getEquivalentICmp() 267 APInt MinValue = APInt::getSignedMinValue(BitWidth); in makeExactMulNSWRegion() 268 APInt MaxValue = APInt::getSignedMaxValue(BitWidth); in makeExactMulNSWRegion() 310 APInt SignedMinVal = APInt::getSignedMinValue(BitWidth); in makeGuaranteedNoWrapRegion() 742 APInt Min = APInt::getMinValue(BW); in castOp() 743 APInt Max = APInt::getMaxValue(BW); in castOp() 753 APInt SMin = APInt::getSignedMinValue(BW); in castOp() 754 APInt SMax = APInt::getSignedMaxValue(BW); in castOp() 1239 APInt Zero = APInt::getZero(getBitWidth()); in sdiv() [all …]
|
| H A D | Operator.cpp | 87 const DataLayout &DL, APInt &Offset, in accumulateConstantOffset() 99 APInt &Offset, function_ref<bool(Value &, APInt &)> ExternalAnalysis) { in accumulateConstantOffset() 103 APInt IndexedSize = APInt(Offset.getBitWidth(), Size); in accumulateConstantOffset() 111 APInt OffsetPlus = Index.smul_ov(IndexedSize, Overflow); in accumulateConstantOffset() 160 APInt AnalysisIndex; in accumulateConstantOffset() 173 MapVector<Value *, APInt> &VariableOffsets, in collectOffset() 174 APInt &ConstantOffset) const { in collectOffset() 178 auto CollectConstantOffset = [&](APInt Index, uint64_t Size) { in collectOffset() 180 APInt IndexedSize = APInt(BitWidth, Size); in collectOffset() 218 APInt IndexedSize = in collectOffset() [all …]
|
| /llvm-project-15.0.7/mlir/include/mlir/Interfaces/ |
| H A D | InferIntRangeInterface.h | 30 ConstantIntRanges(const APInt &umin, const APInt &umax, const APInt &smin, in ConstantIntRanges() 31 const APInt &smax) in ConstantIntRanges() 42 const APInt &umin() const; 45 const APInt &umax() const; 48 const APInt &smin() const; 51 const APInt &smax() const; 71 static ConstantIntRanges range(const APInt &min, const APInt &max, 78 static ConstantIntRanges fromSigned(const APInt &smin, const APInt &smax); 83 static ConstantIntRanges fromUnsigned(const APInt &umin, const APInt &umax); 96 Optional<APInt> getConstantValue() const; [all …]
|
| /llvm-project-15.0.7/llvm/lib/Analysis/ |
| H A D | DemandedBits.cpp | 82 const APInt &AOut, APInt &AB, KnownBits &Known, KnownBits &Known2, in determineLiveOperandBits() 147 const APInt *SA; in determineLiveOperandBits() 202 const APInt *ShiftAmtC; in determineLiveOperandBits() 219 const APInt *ShiftAmtC; in determineLiveOperandBits() 233 const APInt *ShiftAmtC; in determineLiveOperandBits() 376 APInt AOut; in performAnalysis() 404 APInt AB = APInt::getAllOnes(BitWidth); in performAnalysis() 406 AB = APInt(BitWidth, 0); in performAnalysis() 460 return APInt(BitWidth, 0); in getDemandedBits() 465 APInt AB = APInt::getAllOnes(BitWidth); in getDemandedBits() [all …]
|
| /llvm-project-15.0.7/lldb/unittests/Utility/ |
| H A D | ScalarTest.cpp | 20 using llvm::APInt; 103 EXPECT_EQ(APInt(128, 0), Scalar(-std::pow(2.0f, 70.0f)).UInt128(APInt())); in TEST() 105 EXPECT_EQ(APInt(128, 1) << 70, Scalar(std::pow(2.0, 70.0)).SInt128(APInt())); in TEST() 109 EXPECT_EQ(APInt(128, 0), Scalar(-std::pow(2.0, 70.0)).UInt128(APInt())); in TEST() 296 EXPECT_EQ(APInt(64, 47), a.UInt128(APInt())); in TEST() 304 EXPECT_EQ(APInt(64, 47), a.UInt128(APInt())); in TEST() 367 EXPECT_EQ(APInt(width, 24), A.UInt128(APInt())); in TEST() 395 EXPECT_EQ(S.UInt128(APInt()), APInt(12, 0xfffu)); in TEST() 397 EXPECT_EQ(S.UInt128(APInt()), APInt(20, 0xfffffu)); in TEST() 399 EXPECT_EQ(S.UInt128(APInt()), APInt(24, 0x0fffffu)); in TEST() [all …]
|
| /llvm-project-15.0.7/llvm/unittests/CodeGen/GlobalISel/ |
| H A D | ConstantFoldingTest.cpp | 83 Optional<APInt> FoldGAddInt = in TEST_F() 88 Optional<APInt> FoldGAddMix = in TEST_F() 95 Optional<APInt> FoldGAndInt = in TEST_F() 100 Optional<APInt> FoldGAndMix = in TEST_F() 107 Optional<APInt> FoldGAShrInt = in TEST_F() 131 Optional<APInt> FoldGMulInt = in TEST_F() 136 Optional<APInt> FoldGMulMix = in TEST_F() 143 Optional<APInt> FoldGOrInt = in TEST_F() 148 Optional<APInt> FoldGOrMix = in TEST_F() 155 Optional<APInt> FoldGShlInt = in TEST_F() [all …]
|
| /llvm-project-15.0.7/llvm/include/llvm/IR/ |
| H A D | ConstantRange.h | 48 APInt Lower, Upper; 65 ConstantRange(APInt Value); 70 ConstantRange(APInt Lower, APInt Upper); 84 static ConstantRange getNonEmpty(APInt Lower, APInt Upper) { in getNonEmpty() 195 getEquivalentICmp(CmpInst::Predicate &Pred, APInt &RHS, APInt &Offset) const; 240 bool contains(const APInt &Val) const; 246 const APInt *getSingleElement() const { in getSingleElement() 276 APInt getUnsignedMax() const; 279 APInt getUnsignedMin() const; 282 APInt getSignedMax() const; [all …]
|
| /llvm-project-15.0.7/llvm/unittests/Support/ |
| H A D | KnownBitsTest.cpp | 34 APInt Add = N1 + N2; in TEST() 65 APInt Res; in TestAddSubExhaustive() 125 APInt Res; in TEST() 269 APInt Res = N * N; in TEST() 289 APInt Res = N.abs(); in TEST() 400 APInt Min = APInt::getMaxValue(Bits); in TEST() 401 APInt Max = APInt::getMinValue(Bits); in TEST() 414 APInt Min = APInt::getSignedMaxValue(Bits); in TEST() 415 APInt Max = APInt::getSignedMinValue(Bits); in TEST() 479 APInt CommonOne = APInt::getAllOnes(Bits); in TEST() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Transforms/InstCombine/ |
| H A D | InstCombineSimplifyDemanded.cpp | 37 const APInt *C; in ShrinkDemandedConstant() 58 APInt DemandedMask(APInt::getAllOnes(BitWidth)); in SimplifyDemandedInstructionBits() 299 const APInt *C; in SimplifyDemandedUseBits() 724 APInt HighBits(APInt::getHighBitsSet( in SimplifyDemandedUseBits() 782 APInt Mask2 = LowBits | APInt::getSignMask(BitWidth); in SimplifyDemandedUseBits() 817 APInt AllOnes = APInt::getAllOnes(BitWidth); in SimplifyDemandedUseBits() 1115 APInt BitMask1(APInt::getAllOnes(BitWidth)); in simplifyShrShlDemandedBits() 1116 APInt BitMask2(APInt::getAllOnes(BitWidth)); in simplifyShrShlDemandedBits() 1182 APInt EltMask(APInt::getAllOnes(VWidth)); in SimplifyDemandedVectorElts() 1253 APInt Demanded, APInt &Undef) { in SimplifyDemandedVectorElts() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Target/AMDGPU/MCTargetDesc/ |
| H A D | AMDGPUMCCodeEmitter.h | 38 APInt &Inst, APInt &Scratch, 42 APInt &Op, SmallVectorImpl<MCFixup> &Fixups, 45 virtual void getSOPPBrEncoding(const MCInst &MI, unsigned OpNo, APInt &Op, 49 virtual void getSMEMOffsetEncoding(const MCInst &MI, unsigned OpNo, APInt &Op, 53 virtual void getSDWASrcEncoding(const MCInst &MI, unsigned OpNo, APInt &Op, 58 APInt &Op, 62 virtual void getAVOperandEncoding(const MCInst &MI, unsigned OpNo, APInt &Op,
|
| /llvm-project-15.0.7/llvm/unittests/CodeGen/ |
| H A D | AArch64SelectionDAGTest.cpp | 205 APInt DemandedBits = APInt(8, 0xFF); in TEST_F() 228 APInt DemandedBits = APInt(8, 0xFF); in TEST_F() 283 APInt UndefElts; in TEST_F() 284 APInt DemandedElts; in TEST_F() 307 APInt UndefElts; in TEST_F() 327 APInt UndefElts; in TEST_F() 351 APInt UndefElts; in TEST_F() 516 APInt Mask1111_0 = APInt::getOneBitSet(NumElts, 0); in TEST_F() 522 APInt Mask1111_1 = APInt::getOneBitSet(NumElts, 2); in TEST_F() 528 APInt Mask0123 = APInt(NumElts, 0x7777); in TEST_F() [all …]
|
| /llvm-project-15.0.7/llvm/include/llvm/Analysis/ |
| H A D | DemandedBits.h | 54 APInt getDemandedBits(Instruction *I); 57 APInt getDemandedBits(Use *U); 69 static APInt determineLiveOperandBitsAdd(unsigned OperandNo, 70 const APInt &AOut, 76 static APInt determineLiveOperandBitsSub(unsigned OperandNo, 77 const APInt &AOut, 85 const APInt &AOut, APInt &AB, 96 DenseMap<Instruction *, APInt> AliveBits;
|