Home
last modified time | relevance | path

Searched refs:isPowerOf2 (Results 1 – 25 of 69) sorted by relevance

123

/freebsd-14.2/contrib/llvm-project/llvm/lib/Analysis/
H A DCmpInstAnalysis.cpp118 if (!C->isPowerOf2()) in decomposeBitTestICmp()
125 if (!(*C + 1).isPowerOf2()) in decomposeBitTestICmp()
132 if (!(*C + 1).isPowerOf2()) in decomposeBitTestICmp()
139 if (!C->isPowerOf2()) in decomposeBitTestICmp()
H A DTargetTransformInfo.cpp813 if (CI->getValue().isPowerOf2()) in getOperandInfo()
837 if (CI->getValue().isPowerOf2()) in getOperandInfo()
846 AllPow2 &= CI->getValue().isPowerOf2(); in getOperandInfo()
/freebsd-14.2/contrib/llvm-project/clang/include/clang/Basic/
H A DSanitizers.h74 bool isPowerOf2() const { in isPowerOf2() function
160 assert(K.isPowerOf2() && "Has to be a single sanitizer."); in has()
169 assert(K.isPowerOf2() && "Has to be a single sanitizer."); in set()
/freebsd-14.2/contrib/llvm-project/llvm/lib/Target/AArch64/GISel/
H A DAArch64PostLegalizerCombiner.cpp197 if (SCVMinus1.isPowerOf2()) { in matchAArch64MulConstCombine()
200 } else if (CVPlus1.isPowerOf2()) { in matchAArch64MulConstCombine()
210 if (CVNegPlus1.isPowerOf2()) { in matchAArch64MulConstCombine()
214 } else if (CVNegMinus1.isPowerOf2()) { in matchAArch64MulConstCombine()
/freebsd-14.2/contrib/llvm-project/llvm/lib/CodeGen/
H A DExpandLargeDivRem.cpp50 return Val.isPowerOf2(); in isConstantPowerOfTwo()
/freebsd-14.2/contrib/llvm-project/clang/lib/CodeGen/
H A DSwiftCallingConv.cpp28 static bool isPowerOf2(unsigned n) { in isPowerOf2() function
425 assert(isPowerOf2(unitSize.getQuantity())); in getOffsetAtStartOfUnit()
708 if (numElts >= 4 && isPowerOf2(numElts)) { in splitLegalVectorType()
772 if (numElts > 2 && !isPowerOf2(numElts) && in legalizeVectorType()
/freebsd-14.2/contrib/llvm-project/llvm/lib/Target/CSKY/
H A DCSKYISelLowering.cpp1392 if ((Imm + 1).isPowerOf2() || (Imm - 1).isPowerOf2() || in decomposeMulByConstant()
1393 (1 - Imm).isPowerOf2()) in decomposeMulByConstant()
1398 if (!Subtarget.hasE2() && (-1 - Imm).isPowerOf2()) in decomposeMulByConstant()
1402 if (Imm.ugt(0xffff) && ((Imm - 2).isPowerOf2() || (Imm - 4).isPowerOf2()) && in decomposeMulByConstant()
1405 if (Imm.ugt(0xffff) && (Imm - 8).isPowerOf2() && Subtarget.has2E3()) in decomposeMulByConstant()
/freebsd-14.2/contrib/llvm-project/llvm/lib/Target/RISCV/
H A DRISCVTargetTransformInfo.cpp172 if (ST->hasStdExtZbs() && (~Imm).isPowerOf2()) in getIntImmCostInst()
185 if (ST->hasStdExtZbs() && Imm.isPowerOf2()) in getIntImmCostInst()
191 if (Imm.isPowerOf2() || Imm.isNegatedPowerOf2()) in getIntImmCostInst()
194 if ((Imm + 1).isPowerOf2() || (Imm - 1).isPowerOf2()) in getIntImmCostInst()
/freebsd-14.2/contrib/llvm-project/llvm/lib/Transforms/InstCombine/
H A DInstCombineCompares.cpp1079 if (!CI2->getValue().isPowerOf2()) in processUGT_ADDCST_ADD()
1437 if (C.isPowerOf2()) in foldICmpTruncConstant()
1592 if (*XorC == C && (C + 1).isPowerOf2()) in foldICmpXorConstant()
1597 if (*XorC == -C && C.isPowerOf2()) in foldICmpXorConstant()
1601 if (*XorC == C && (-C).isPowerOf2()) in foldICmpXorConstant()
1622 if (!PowerOf2.isPowerOf2()) in foldICmpXorShiftConst()
2178 bool CIsPowerOf2 = C.isPowerOf2(); in foldICmpShlOne()
2335 if ((C + 1).isPowerOf2() && in foldICmpShlConstant()
2343 if (C.isPowerOf2() && in foldICmpShlConstant()
4178 assert(ICmpCst.isPowerOf2()); in foldICmpWithTruncSignExtendedVal()
[all …]
H A DInstCombineAndOrXor.cpp125 bool IsAPow2 = ConstA && ConstA->isPowerOf2(); in getMaskedICmpType()
126 bool IsBPow2 = ConstB && ConstB->isPowerOf2(); in getMaskedICmpType()
386 (*BCst & (*BCst ^ *DCst)).isPowerOf2()) { in foldLogOpOfMaskedICmps_NotAllZeros_BMask_Mixed()
805 assert(HighestBit.isPowerOf2() && "expected to be power of two (non-zero)"); in foldSignedTruncationCheck()
857 if (!OtherHighestBit.isPowerOf2()) in foldSignedTruncationCheck()
1273 if (!LowerDiff.isPowerOf2() || LowerDiff != UpperDiff || in foldAndOrOfICmpsUsingRanges()
2299 if (Op0->hasOneUse() && C->isPowerOf2() && (*AddC & (*C - 1)) == 0) { in visitAnd()
2390 if (C->isPowerOf2() && in visitAnd()
2406 if (C3->isPowerOf2()) { in visitAnd()
H A DInstCombineAddSub.cpp951 if (C->isPowerOf2()) in foldAddWithConstant()
953 else if (C2->isPowerOf2()) in foldAddWithConstant()
1093 if (match(E, m_And(m_Value(Op), m_APInt(AI))) && (*AI + 1).isPowerOf2()) { in MatchRem()
1566 C1->isPowerOf2() && (ComputeNumSignBits(A) > C1->countl_zero())) { in visitAdd()
2354 if ((*C3 - C2AndC3Minus1).isPowerOf2() && in visitSub()
H A DInstCombineCasts.cpp928 bool IsExpectShAmt = KnownZeroMask.isPowerOf2() && in transformZExtICmp()
1282 Cmp->isEquality() && (Op1C->isZero() || Op1C->getValue().isPowerOf2())){ in transformSExtICmp()
1286 if (KnownZeroMask.isPowerOf2()) { in transformSExtICmp()
H A DInstCombineSimplifyDemanded.cpp609 if (DemandedMask.isPowerOf2()) { in SimplifyDemandedUseBits()
844 if (RA.isPowerOf2()) { in SimplifyDemandedUseBits()
H A DInstCombineSelect.cpp150 if (!AndMask.isPowerOf2()) in foldSelectICmpAnd()
196 if (!TC.isPowerOf2() && !FC.isPowerOf2()) in foldSelectICmpAnd()
738 !C1.isPowerOf2()) in foldSelectICmpAndBinOp()
/freebsd-14.2/contrib/llvm-project/llvm/lib/Transforms/Scalar/
H A DAlignmentFromAssumptions.cpp178 if (!cast<SCEVConstant>(AlignSCEV)->getAPInt().isPowerOf2()) in extractAlignmentInfo()
H A DSeparateConstOffsetFromGEP.cpp890 if (ElementSize.isPowerOf2()) { in lowerToSingleIndexGEPs()
950 if (ElementSize.isPowerOf2()) { in lowerToArithmetics()
H A DStraightLineStrengthReduce.cpp598 if (IndexOffset.isPowerOf2()) { in emitBump()
/freebsd-14.2/contrib/llvm-project/llvm/lib/Target/LoongArch/
H A DLoongArchISelLowering.cpp4832 if ((Imm + 1).isPowerOf2() || (Imm - 1).isPowerOf2() || in decomposeMulByConstant()
4833 (1 - Imm).isPowerOf2() || (-1 - Imm).isPowerOf2()) in decomposeMulByConstant()
4837 ((Imm - 2).isPowerOf2() || (Imm - 4).isPowerOf2() || in decomposeMulByConstant()
4838 (Imm - 8).isPowerOf2() || (Imm - 16).isPowerOf2())) in decomposeMulByConstant()
4857 if ((Imm - ImmSmall).isPowerOf2() || (Imm + ImmSmall).isPowerOf2() || in decomposeMulByConstant()
4858 (ImmSmall - Imm).isPowerOf2()) in decomposeMulByConstant()
/freebsd-14.2/contrib/llvm-project/llvm/lib/Target/AArch64/
H A DAArch64FastISel.cpp581 if (C->getValue().isPowerOf2()) in isMulPowOf2()
584 if (C->getValue().isPowerOf2()) in isMulPowOf2()
808 if (C->getValue().isPowerOf2()) in computeAddress()
1248 if (C->getValue().isPowerOf2()) in emitAddSub()
1617 if (C->getValue().isPowerOf2()) in emitLogicalOp()
2309 if (C->getValue().isPowerOf2()) in emitCompareAndBranch()
2313 if (C->getValue().isPowerOf2()) { in emitCompareAndBranch()
4651 if (C->getValue().isPowerOf2()) in selectMul()
4656 if (C->getValue().isPowerOf2()) { in selectMul()
4884 !(C.isPowerOf2() || C.isNegatedPowerOf2())) in selectSDiv()
/freebsd-14.2/contrib/llvm-project/llvm/lib/Support/
H A DKnownBits.cpp904 if (RHS.isConstant() && RHS.getConstant().isPowerOf2()) { in urem()
923 if (RHS.isConstant() && RHS.getConstant().isPowerOf2()) { in srem()
/freebsd-14.2/contrib/llvm-project/llvm/include/llvm/ADT/
H A DAPInt.h418 bool isPowerOf2() const { in isPowerOf2() function
1719 if (!isPowerOf2()) in exactLogBase2()
/freebsd-14.2/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/
H A DUtils.cpp1011 return CI->getValue().zextOrTrunc(BitWidth).isPowerOf2(); in isKnownToBeAPowerOfTwo()
1048 if (!Const || !Const->zextOrTrunc(BitWidth).isPowerOf2()) in isKnownToBeAPowerOfTwo()
/freebsd-14.2/contrib/llvm-project/clang/lib/Sema/
H A DSemaStmtAttr.cpp342 ArgVal > CodeAlignAttr::MaximumAlignment || !ArgVal.isPowerOf2()) { in BuildCodeAlignAttr()
/freebsd-14.2/contrib/llvm-project/llvm/lib/Transforms/AggressiveInstCombine/
H A DAggressiveInstCombine.cpp359 if (!(*MinC + 1).isPowerOf2() || -*MaxC != *MinC + 1) in tryToFPToSat()
/freebsd-14.2/contrib/llvm-project/llvm/lib/Transforms/Utils/
H A DScalarEvolutionExpander.cpp612 if (RHS.isPowerOf2()) in visitUDivExpr()
1775 if (SC->getAPInt().isPowerOf2()) in costAndCollectOperands()

123