Home
last modified time | relevance | path

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

123

/freebsd/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.cpp843 if (CI->getValue().isPowerOf2()) in getOperandInfo()
867 if (CI->getValue().isPowerOf2()) in getOperandInfo()
876 AllPow2 &= CI->getValue().isPowerOf2(); in getOperandInfo()
H A DBranchProbabilityInfo.cpp990 if (AndRHS->getValue().isPowerOf2()) in calcZeroHeuristics()
/freebsd/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/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/contrib/llvm-project/llvm/lib/Target/CSKY/
H A DCSKYISelLowering.cpp1390 if ((Imm + 1).isPowerOf2() || (Imm - 1).isPowerOf2() || in decomposeMulByConstant()
1391 (1 - Imm).isPowerOf2()) in decomposeMulByConstant()
1396 if (!Subtarget.hasE2() && (-1 - Imm).isPowerOf2()) in decomposeMulByConstant()
1400 if (Imm.ugt(0xffff) && ((Imm - 2).isPowerOf2() || (Imm - 4).isPowerOf2()) && in decomposeMulByConstant()
1403 if (Imm.ugt(0xffff) && (Imm - 8).isPowerOf2() && Subtarget.has2E3()) in decomposeMulByConstant()
/freebsd/contrib/llvm-project/llvm/lib/CodeGen/
H A DExpandLargeDivRem.cpp50 return Val.isPowerOf2(); in isConstantPowerOfTwo()
/freebsd/contrib/llvm-project/llvm/lib/Transforms/InstCombine/
H A DInstCombineCompares.cpp1005 if (AP1.isAllOnes() && !AP2.isPowerOf2()) in foldICmpShrConstConst()
1080 if (!CI2->getValue().isPowerOf2()) in processUGT_ADDCST_ADD()
1448 if (C.isPowerOf2()) in foldICmpTruncConstant()
1606 if (*XorC == ~C && (C + 1).isPowerOf2()) in foldICmpXorConstant()
1609 if (*XorC == C && (C + 1).isPowerOf2()) in foldICmpXorConstant()
1614 if (*XorC == -C && C.isPowerOf2()) in foldICmpXorConstant()
1618 if (*XorC == C && (-C).isPowerOf2()) in foldICmpXorConstant()
1639 if (!PowerOf2.isPowerOf2()) in foldICmpXorShiftConst()
2063 if (*MaskC == C && (C + 1).isPowerOf2()) { in foldICmpOrConstant()
2238 bool CIsPowerOf2 = C.isPowerOf2(); in foldICmpShlOne()
[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()
844 assert(HighestBit.isPowerOf2() && "expected to be power of two (non-zero)"); in foldSignedTruncationCheck()
896 if (!OtherHighestBit.isPowerOf2()) in foldSignedTruncationCheck()
1316 if (!LowerDiff.isPowerOf2() || LowerDiff != UpperDiff || in foldAndOrOfICmpsUsingRanges()
2424 if (Op0->hasOneUse() && C->isPowerOf2() && (*AddC & (*C - 1)) == 0) { in visitAnd()
2515 if (C->isPowerOf2() && in visitAnd()
2531 if (C3->isPowerOf2()) { in visitAnd()
H A DInstCombineShifts.cpp1493 if (BitWidth > 2 && (*MulC - 1).isPowerOf2() && in visitLShr()
1532 if (BitWidth > 2 && (*MulC - 1).isPowerOf2() && in visitLShr()
1746 (BitWidth > 2 && (*MulC - 1).isPowerOf2() && in visitAShr()
H A DInstCombineAddSub.cpp964 if (C->isPowerOf2()) in foldAddWithConstant()
966 else if (C2->isPowerOf2()) in foldAddWithConstant()
1106 if (match(E, m_And(m_Value(Op), m_APInt(AI))) && (*AI + 1).isPowerOf2()) { in MatchRem()
1608 C1->isPowerOf2() && (ComputeNumSignBits(A) > C1->countl_zero())) { in visitAdd()
2349 if ((*C3 - C2AndC3Minus1).isPowerOf2() && in visitSub()
H A DInstCombineCasts.cpp962 bool IsExpectShAmt = KnownZeroMask.isPowerOf2() && in transformZExtICmp()
1320 Cmp->isEquality() && (Op1C->isZero() || Op1C->getValue().isPowerOf2())){ in transformSExtICmp()
1324 if (KnownZeroMask.isPowerOf2()) { in transformSExtICmp()
H A DInstCombineSimplifyDemanded.cpp607 if (DemandedMask.isPowerOf2()) { in SimplifyDemandedUseBits()
868 if (RA.isPowerOf2()) { in SimplifyDemandedUseBits()
H A DInstCombineSelect.cpp151 if (!AndMask.isPowerOf2()) in foldSelectICmpAnd()
197 if (!TC.isPowerOf2() && !FC.isPowerOf2()) in foldSelectICmpAnd()
754 !C1.isPowerOf2()) in foldSelectICmpAndBinOp()
/freebsd/contrib/llvm-project/llvm/lib/Target/RISCV/
H A DRISCVTargetTransformInfo.cpp212 if (ST->hasStdExtZbs() && (~Imm).isPowerOf2()) in getIntImmCostInst()
225 if (ST->hasStdExtZbs() && Imm.isPowerOf2()) in getIntImmCostInst()
231 if (Imm.isPowerOf2() || Imm.isNegatedPowerOf2()) in getIntImmCostInst()
234 if ((Imm + 1).isPowerOf2() || (Imm - 1).isPowerOf2()) in getIntImmCostInst()
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/
H A DSeparateConstOffsetFromGEP.cpp890 if (ElementSize.isPowerOf2()) { in lowerToSingleIndexGEPs()
950 if (ElementSize.isPowerOf2()) { in lowerToArithmetics()
H A DStraightLineStrengthReduce.cpp596 if (IndexOffset.isPowerOf2()) { in emitBump()
/freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/
H A DAArch64FastISel.cpp582 if (C->getValue().isPowerOf2()) in isMulPowOf2()
585 if (C->getValue().isPowerOf2()) in isMulPowOf2()
809 if (C->getValue().isPowerOf2()) in computeAddress()
1249 if (C->getValue().isPowerOf2()) in emitAddSub()
1618 if (C->getValue().isPowerOf2()) in emitLogicalOp()
2310 if (C->getValue().isPowerOf2()) in emitCompareAndBranch()
2314 if (C->getValue().isPowerOf2()) { in emitCompareAndBranch()
4665 if (C->getValue().isPowerOf2()) in selectMul()
4670 if (C->getValue().isPowerOf2()) { in selectMul()
4898 !(C.isPowerOf2() || C.isNegatedPowerOf2())) in selectSDiv()
/freebsd/contrib/llvm-project/llvm/lib/Support/
H A DKnownBits.cpp1044 if (RHS.isConstant() && RHS.getConstant().isPowerOf2()) { in urem()
1061 if (RHS.isConstant() && RHS.getConstant().isPowerOf2()) { in srem()
/freebsd/contrib/llvm-project/llvm/include/llvm/ADT/
H A DAPInt.h420 bool isPowerOf2() const { in isPowerOf2() function
1742 if (!isPowerOf2()) in exactLogBase2()
/freebsd/contrib/llvm-project/llvm/lib/Target/LoongArch/
H A DLoongArchISelLowering.cpp6028 if ((Imm + 1).isPowerOf2() || (Imm - 1).isPowerOf2() || in decomposeMulByConstant()
6029 (1 - Imm).isPowerOf2() || (-1 - Imm).isPowerOf2()) in decomposeMulByConstant()
6033 ((Imm - 2).isPowerOf2() || (Imm - 4).isPowerOf2() || in decomposeMulByConstant()
6034 (Imm - 8).isPowerOf2() || (Imm - 16).isPowerOf2())) in decomposeMulByConstant()
6053 if ((Imm - ImmSmall).isPowerOf2() || (Imm + ImmSmall).isPowerOf2() || in decomposeMulByConstant()
6054 (ImmSmall - Imm).isPowerOf2()) in decomposeMulByConstant()
/freebsd/contrib/llvm-project/clang/lib/Sema/
H A DSemaStmtAttr.cpp361 ArgVal > CodeAlignAttr::MaximumAlignment || !ArgVal.isPowerOf2()) { in BuildCodeAlignAttr()
/freebsd/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/
H A DUtils.cpp1103 return CI->getValue().zextOrTrunc(BitWidth).isPowerOf2(); in isKnownToBeAPowerOfTwo()
1140 if (!Const || !Const->zextOrTrunc(BitWidth).isPowerOf2()) in isKnownToBeAPowerOfTwo()
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/
H A DScalarEvolutionExpander.cpp661 if (RHS.isPowerOf2()) in visitUDivExpr()
1873 if (SC->getAPInt().isPowerOf2()) in costAndCollectOperands()
/freebsd/contrib/llvm-project/llvm/lib/Target/SystemZ/
H A DSystemZTargetTransformInfo.cpp466 if (CVal && (CVal->getValue().isPowerOf2() || in getArithmeticInstrCost()

123