Home
last modified time | relevance | path

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

123

/freebsd/contrib/llvm-project/clang/include/clang/Basic/
H A DSanitizers.h74 bool isPowerOf2() const { in isPowerOf2() function
175 assert(K.isPowerOf2() && "Has to be a single sanitizer."); in has()
188 assert(K.isPowerOf2() && "Has to be a single sanitizer."); in set()
/freebsd/contrib/llvm-project/llvm/lib/Analysis/
H A DCmpInstAnalysis.cpp115 if (FlippedSign.isPowerOf2()) { in decomposeBitTestICmp()
135 if (C.isPowerOf2()) { in decomposeBitTestICmp()
H A DTargetTransformInfo.cpp896 if (CI->getValue().isPowerOf2()) in getOperandInfo()
923 if (CI->getValue().isPowerOf2()) in getOperandInfo()
934 AllPow2 &= CI->getValue().isPowerOf2(); in getOperandInfo()
/freebsd/contrib/llvm-project/clang/lib/CodeGen/
H A DSwiftCallingConv.cpp27 static bool isPowerOf2(unsigned n) { in isPowerOf2() function
424 assert(isPowerOf2(unitSize.getQuantity())); in getOffsetAtStartOfUnit()
707 if (numElts >= 4 && isPowerOf2(numElts)) { in splitLegalVectorType()
771 if (numElts > 2 && !isPowerOf2(numElts) && in legalizeVectorType()
/freebsd/contrib/llvm-project/llvm/lib/Target/CSKY/
H A DCSKYISelLowering.cpp1361 if ((Imm + 1).isPowerOf2() || (Imm - 1).isPowerOf2() || in decomposeMulByConstant()
1362 (1 - Imm).isPowerOf2()) in decomposeMulByConstant()
1367 if (!Subtarget.hasE2() && (-1 - Imm).isPowerOf2()) in decomposeMulByConstant()
1371 if (Imm.ugt(0xffff) && ((Imm - 2).isPowerOf2() || (Imm - 4).isPowerOf2()) && in decomposeMulByConstant()
1374 if (Imm.ugt(0xffff) && (Imm - 8).isPowerOf2() && Subtarget.has2E3()) in decomposeMulByConstant()
/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/llvm/lib/CodeGen/
H A DExpandLargeDivRem.cpp49 return Val.isPowerOf2(); in isConstantPowerOfTwo()
/freebsd/contrib/llvm-project/llvm/lib/Transforms/InstCombine/
H A DInstCombineCompares.cpp1033 if (AP1.isAllOnes() && !AP2.isPowerOf2()) in foldICmpShrConstConst()
1108 if (!CI2->getValue().isPowerOf2()) in processUGT_ADDCST_ADD()
1484 if (C.isPowerOf2()) in foldICmpTruncConstant()
1642 if (*XorC == ~C && (C + 1).isPowerOf2()) in foldICmpXorConstant()
1645 if (*XorC == C && (C + 1).isPowerOf2()) in foldICmpXorConstant()
1650 if (*XorC == -C && C.isPowerOf2()) in foldICmpXorConstant()
1654 if (*XorC == C && (-C).isPowerOf2()) in foldICmpXorConstant()
1675 if (!PowerOf2.isPowerOf2()) in foldICmpXorShiftConst()
2108 if (*MaskC == C && (C + 1).isPowerOf2()) { in foldICmpOrConstant()
2290 bool CIsPowerOf2 = Rem.isZero() && Div.isPowerOf2(); in foldICmpShlLHSC()
[all …]
H A DInstCombineAndOrXor.cpp126 bool IsAPow2 = ConstA && ConstA->isPowerOf2(); in getMaskedICmpType()
127 bool IsBPow2 = ConstB && ConstB->isPowerOf2(); in getMaskedICmpType()
424 (*BCst & (*BCst ^ *DCst)).isPowerOf2()) { in foldLogOpOfMaskedICmps_NotAllZeros_BMask_Mixed()
871 assert(HighestBit.isPowerOf2() && "expected to be power of two (non-zero)"); in foldSignedTruncationCheck()
921 if (!OtherHighestBit.isPowerOf2()) in foldSignedTruncationCheck()
1364 if (!LowerDiff.isPowerOf2() || LowerDiff != UpperDiff || in foldAndOrOfICmpsUsingRanges()
2501 if (Op0->hasOneUse() && C->isPowerOf2() && (*AddC & (*C - 1)) == 0) { in visitAnd()
2592 if (C->isPowerOf2() && in visitAnd()
2608 if (C3->isPowerOf2()) { in visitAnd()
3652 if (!ICmpDecompose->Mask.isPowerOf2() || ICmpDecompose->Mask.isZero() || in matchBitmaskMul()
H A DInstCombineAddSub.cpp964 if (C->isPowerOf2()) in foldAddWithConstant()
966 else if (C2->isPowerOf2()) in foldAddWithConstant()
1112 if (match(E, m_And(m_Value(Op), m_APInt(AI))) && (*AI + 1).isPowerOf2()) { in MatchRem()
1199 !(C1.isOne() && !IsSigned && DivOpC.isPowerOf2() && DivOpC != 2)) { in SimplifyAddWithRemainder()
1643 C1->isPowerOf2() && (ComputeNumSignBits(A) > C1->countl_zero())) { in visitAdd()
2510 if ((*C3 - C2AndC3Minus1).isPowerOf2() && in visitSub()
H A DInstCombineShifts.cpp1520 if (BitWidth > 2 && (*MulC - 1).isPowerOf2() && in visitLShr()
1559 if (BitWidth > 2 && (*MulC - 1).isPowerOf2() && in visitLShr()
1794 (BitWidth > 2 && (*MulC - 1).isPowerOf2() && in visitAShr()
H A DInstCombineCasts.cpp1009 bool IsExpectShAmt = KnownZeroMask.isPowerOf2() && in transformZExtICmp()
1371 Cmp->isEquality() && (Op1C->isZero() || Op1C->getValue().isPowerOf2())){ in transformSExtICmp()
1375 if (KnownZeroMask.isPowerOf2()) { in transformSExtICmp()
H A DInstCombineSimplifyDemanded.cpp622 if (DemandedMask.isPowerOf2()) { in SimplifyDemandedUseBits()
886 if (match(I->getOperand(1), m_APInt(Rem)) && Rem->isPowerOf2()) { in SimplifyDemandedUseBits()
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/
H A DAlignmentFromAssumptions.cpp178 if (!cast<SCEVConstant>(AlignSCEV)->getAPInt().isPowerOf2()) in extractAlignmentInfo()
H A DSeparateConstOffsetFromGEP.cpp920 if (ElementSize.isPowerOf2()) { in lowerToSingleIndexGEPs()
980 if (ElementSize.isPowerOf2()) { in lowerToArithmetics()
H A DStraightLineStrengthReduce.cpp600 if (IndexOffset.isPowerOf2()) { in emitBump()
/freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/
H A DAArch64FastISel.cpp577 if (C->getValue().isPowerOf2()) in isMulPowOf2()
580 if (C->getValue().isPowerOf2()) in isMulPowOf2()
804 if (C->getValue().isPowerOf2()) in computeAddress()
1244 if (C->getValue().isPowerOf2()) in emitAddSub()
1615 if (C->getValue().isPowerOf2()) in emitLogicalOp()
2308 if (C->getValue().isPowerOf2()) in emitCompareAndBranch()
2312 if (C->getValue().isPowerOf2()) { in emitCompareAndBranch()
4668 if (C->getValue().isPowerOf2()) in selectMul()
4673 if (C->getValue().isPowerOf2()) { in selectMul()
4900 !(C.isPowerOf2() || C.isNegatedPowerOf2())) in selectSDiv()
/freebsd/contrib/llvm-project/llvm/lib/Support/
H A DKnownBits.cpp1051 if (RHS.isConstant() && RHS.getConstant().isPowerOf2()) { in urem()
1068 if (RHS.isConstant() && RHS.getConstant().isPowerOf2()) { in srem()
/freebsd/contrib/llvm-project/llvm/lib/Target/RISCV/
H A DRISCVTargetTransformInfo.cpp221 if (ST->hasStdExtZbs() && (~Imm).isPowerOf2()) in getIntImmCostInst()
234 if (ST->hasStdExtZbs() && Imm.isPowerOf2()) in getIntImmCostInst()
240 if (Imm.isPowerOf2() || Imm.isNegatedPowerOf2()) in getIntImmCostInst()
243 if ((Imm + 1).isPowerOf2() || (Imm - 1).isPowerOf2()) in getIntImmCostInst()
/freebsd/contrib/llvm-project/llvm/include/llvm/ADT/
H A DAPInt.h440 bool isPowerOf2() const { in isPowerOf2() function
1784 if (!isPowerOf2()) in exactLogBase2()
/freebsd/contrib/llvm-project/llvm/lib/Target/LoongArch/
H A DLoongArchISelLowering.cpp8310 if ((Imm + 1).isPowerOf2() || (Imm - 1).isPowerOf2() || in decomposeMulByConstant()
8311 (1 - Imm).isPowerOf2() || (-1 - Imm).isPowerOf2()) in decomposeMulByConstant()
8315 ((Imm - 2).isPowerOf2() || (Imm - 4).isPowerOf2() || in decomposeMulByConstant()
8316 (Imm - 8).isPowerOf2() || (Imm - 16).isPowerOf2())) in decomposeMulByConstant()
8335 if ((Imm - ImmSmall).isPowerOf2() || (Imm + ImmSmall).isPowerOf2() || in decomposeMulByConstant()
8336 (ImmSmall - Imm).isPowerOf2()) in decomposeMulByConstant()
/freebsd/contrib/llvm-project/clang/lib/Sema/
H A DSemaStmtAttr.cpp372 ArgVal > CodeAlignAttr::MaximumAlignment || !ArgVal.isPowerOf2()) { in BuildCodeAlignAttr()
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/
H A DScalarEvolutionExpander.cpp671 if (RHS.isPowerOf2()) in visitUDivExpr()
1900 if (SC->getAPInt().isPowerOf2()) in costAndCollectOperands()
/freebsd/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/
H A DUtils.cpp1121 return CI->getValue().zextOrTrunc(BitWidth).isPowerOf2(); in isKnownToBeAPowerOfTwo()
1158 if (!Const || !Const->zextOrTrunc(BitWidth).isPowerOf2()) in isKnownToBeAPowerOfTwo()
/freebsd/contrib/llvm-project/llvm/include/llvm/Analysis/
H A DTargetTransformInfo.h1172 bool isPowerOf2() const { in isPowerOf2() function

123