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

References

include/llvm/ADT/APInt.h
 1801     if (!isPowerOf2())
include/llvm/IR/PatternMatch.h
  408   bool isValue(const APInt &C) { return C.isPowerOf2(); }
  420   bool isValue(const APInt &C) { return (-C).isPowerOf2(); }
  432   bool isValue(const APInt &C) { return !C || C.isPowerOf2(); }
lib/Analysis/BranchProbabilityInfo.cpp
  686         if (AndRHS->getValue().isPowerOf2())
lib/Analysis/CmpInstAnalysis.cpp
  108     if (!C->isPowerOf2())
  115     if (!(*C + 1).isPowerOf2())
  122     if (!(*C + 1).isPowerOf2())
  129     if (!C->isPowerOf2())
lib/Analysis/InstructionSimplify.cpp
 2902         CI2Val->isPowerOf2()) {
 2903       if (!CIVal->isPowerOf2()) {
 3780   if (Y->isPowerOf2()) {
lib/Analysis/Loads.cpp
   44     assert(APAlign.isPowerOf2() && "must be a power of 2!");
lib/Analysis/ScalarEvolution.cpp
 1920         if (MulLHS->getAPInt().isPowerOf2())
 3171     if (RHSC->getAPInt().isPowerOf2()) {
 3208       if (!RHSC->getAPInt().isPowerOf2())
lib/Analysis/ScalarEvolutionExpander.cpp
  861     if (RHS.isPowerOf2())
 2165       if (SC->getAPInt().isPowerOf2()) {
lib/Analysis/TargetTransformInfo.cpp
  541     if (CI->getValue().isPowerOf2())
  562         if (CI->getValue().isPowerOf2())
  568           if (CI->getValue().isPowerOf2())
lib/Analysis/ValueTracking.cpp
 1236       if (RA.isPowerOf2()) {
 1270       if (RA.isPowerOf2()) {
 1815       if ((~(LHSBits.Zero & RHSBits.Zero)).isPowerOf2())
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
 3393   if (N1IsConst && !N1IsOpaqueConst && (-ConstValue1).isPowerOf2()) {
 3418     if ((MulC - 1).isPowerOf2())
 3420     else if ((MulC + 1).isPowerOf2())
 3697     if (C->getAPIntValue().isPowerOf2())
 3699     if ((-C->getAPIntValue()).isPowerOf2())
 4523         if ((C0Val - C1Val).isPowerOf2()) {
 7861     if (UnknownBits.isPowerOf2()) {
 8284       if (C1Val.isPowerOf2() && C2Val.isNullValue()) {
 8661   if (ISD::isConstantSplatVector(N1.getNode(), Pow2C) && Pow2C.isPowerOf2() &&
13360         if (AndConst.isPowerOf2() &&
20094   bool Fold = N2C && isNullConstant(N3) && N2C->getAPIntValue().isPowerOf2();
20095   bool Swap = N3C && isNullConstant(N2) && N3C->getAPIntValue().isPowerOf2();
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
 3092       if (RA.isPowerOf2()) {
 3116       if (RA.isPowerOf2()) {
 3367     return Const->getAPIntValue().zextOrTrunc(BitWidth).isPowerOf2();
 3389             return C->getAPIntValue().zextOrTrunc(BitWidth).isPowerOf2();
 7053          cast<ConstantSDNode>(N->getScale())->getAPIntValue().isPowerOf2() &&
 7091          cast<ConstantSDNode>(N->getScale())->getAPIntValue().isPowerOf2() &&
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
 3921         if (ElementSize.isPowerOf2()) {
10073       if (CommonBit.isPowerOf2()) {
lib/CodeGen/SelectionDAG/TargetLowering.cpp
 2891     return I1.ugt(I01) && I1.isPowerOf2() && I01.isPowerOf2();
 2891     return I1.ugt(I01) && I1.isPowerOf2() && I01.isPowerOf2();
 3159           if ((C->getAPIntValue()+1).isPowerOf2()) {
 3623           if (AndRHS->getAPIntValue().isPowerOf2() &&
 3633           if (C1.isPowerOf2() &&
 3650           if ((-AndRHSC).isPowerOf2() && (AndRHSC & C1) == C1) {
 7184     if (C.isPowerOf2()) {
lib/IR/Verifier.cpp
 4374     Assert(ElementSizeVal.isPowerOf2(),
 4619     Assert(Alignment->getValue().isPowerOf2(),
 4640     Assert(Alignment->getValue().isPowerOf2(),
lib/Support/APInt.cpp
  542   } else if (isNegative && tmp.isPowerOf2()) {
lib/Target/AArch64/AArch64FastISel.cpp
  569       if (C->getValue().isPowerOf2())
  572       if (C->getValue().isPowerOf2())
  798       if (C->getValue().isPowerOf2())
 1258         if (C->getValue().isPowerOf2())
 1644         if (C->getValue().isPowerOf2())
 2344           if (C->getValue().isPowerOf2())
 2348           if (C->getValue().isPowerOf2()) {
 4689     if (C->getValue().isPowerOf2())
 4694     if (C->getValue().isPowerOf2()) {
 4929       !(C.isPowerOf2() || (-C).isPowerOf2()))
 4929       !(C.isPowerOf2() || (-C).isPowerOf2()))
lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
 2628   if (!IsExact || !IntVal.isPowerOf2()) return false;
lib/Target/AArch64/AArch64ISelLowering.cpp
 9343       !(Divisor.isPowerOf2() || (-Divisor).isPowerOf2()))
 9343       !(Divisor.isPowerOf2() || (-Divisor).isPowerOf2()))
 9430     if (SCVMinus1.isPowerOf2()) {
 9433     } else if (CVPlus1.isPowerOf2()) {
 9443     if (CVNegPlus1.isPowerOf2()) {
 9447     } else if (CVNegMinus1.isPowerOf2()) {
12344   return Mask->getValue().isPowerOf2();
lib/Target/ARM/ARMISelLowering.cpp
13940   return CV->isPowerOf2() ? CV : nullptr;
lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
 2175     if (V1C && NOpcode == ISD::MUL && V1C->getAPIntValue().isPowerOf2())
 2203     if (V1C && V1C->getAPIntValue().isPowerOf2()) {
lib/Target/Mips/MipsSEISelLowering.cpp
  759     if (Val.isPowerOf2()) {
  803   if (C.isPowerOf2())
lib/Target/PowerPC/PPCISelLowering.cpp
14102       !(Divisor.isPowerOf2() || (-Divisor).isPowerOf2()))
14102       !(Divisor.isPowerOf2() || (-Divisor).isPowerOf2()))
14108   bool IsNegPow2 = (-Divisor).isPowerOf2();
15366   if ((MulAmtAbs - 1).isPowerOf2()) {
15383   } else if ((MulAmtAbs + 1).isPowerOf2()) {
lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
  388           (CVal->getValue().isPowerOf2() || (-CVal->getValue()).isPowerOf2()))
  388           (CVal->getValue().isPowerOf2() || (-CVal->getValue()).isPowerOf2()))
lib/Target/X86/X86ISelLowering.cpp
 4948   return (MulC + 1).isPowerOf2() || (MulC - 1).isPowerOf2() ||
 4948   return (MulC + 1).isPowerOf2() || (MulC - 1).isPowerOf2() ||
 4949          (1 - MulC).isPowerOf2() || (-(MulC + 1)).isPowerOf2();
 4949          (1 - MulC).isPowerOf2() || (-(MulC + 1)).isPowerOf2();
20312   assert((Divisor.isPowerOf2() || (-Divisor).isPowerOf2()) &&
20312   assert((Divisor.isPowerOf2() || (-Divisor).isPowerOf2()) &&
20750         if (llvm::all_of(EltBits, [](APInt &V) { return V.isPowerOf2(); })) {
20762     if (C1 && C1->getAPIntValue().isPowerOf2()) {
36693   if (AbsDiff.isPowerOf2() ||
37617       if (FalseC->getAPIntValue() == 0 && TrueC->getAPIntValue().isPowerOf2()) {
lib/Transforms/InstCombine/InstCombineAddSub.cpp
  981   if (match(E, m_And(m_Value(Op), m_APInt(AI))) && (*AI + 1).isPowerOf2()) {
 1236         if (RHSVal.isPowerOf2())
 1238         else if (XorRHS->getValue().isPowerOf2())
 1256       if (LHS->hasOneUse() && (XorRHS->getValue()+1).isPowerOf2()) {
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  133       if (AndRHSV.isPowerOf2()) {
  236   bool IsAPow2 = (ACst && !ACst->isZero() && ACst->getValue().isPowerOf2());
  237   bool IsBPow2 = (BCst && !BCst->isZero() && BCst->getValue().isPowerOf2());
  507       (BCst->getValue() & (BCst->getValue() ^ DCst->getValue())).isPowerOf2()) {
  830   if (Xor.isPowerOf2()) {
  959   assert(HighestBit.isPowerOf2() && "expected to be power of two (non-zero)");
 1011     if (!OtherHighestBit.isPowerOf2())
 1209     if ((PredL == ICmpInst::ICMP_ULT && LHSC->getValue().isPowerOf2()) ||
 2228       if (LAddOpnd == RAddOpnd && DiffC.isPowerOf2()) {
 2244         if (LowRangeDiff.isPowerOf2() && LowRangeDiff == HighRangeDiff &&
lib/Transforms/InstCombine/InstCombineCasts.cpp
  883     if ((Op1CV->isNullValue() || Op1CV->isPowerOf2()) &&
  890       if (KnownZeroMask.isPowerOf2()) { // Exactly 1 possible 1?
 1252         ICI->isEquality() && (Op1C->isZero() || Op1C->getValue().isPowerOf2())){
 1256       if (KnownZeroMask.isPowerOf2()) {
lib/Transforms/InstCombine/InstCombineCompares.cpp
 1195       if (AP1.isAllOnesValue() && !AP2.isPowerOf2())
 1270   if (!CI2->getValue().isPowerOf2())
 1613     if (*XorC == ~C && (C + 1).isPowerOf2())
 1616     if (*XorC == C && (C + 1).isPowerOf2())
 1621     if (*XorC == -C && C.isPowerOf2())
 1625     if (*XorC == C && (-C).isPowerOf2())
 1748     if ((~(*C2) + 1).isPowerOf2()) {
 1852   if (Cmp.getOperand(1) == Y && (-C).isPowerOf2()) {
 1895     if ((C + 1).isPowerOf2()) {
 1969   bool CIsPowerOf2 = C.isPowerOf2();
 2124     if ((C + 1).isPowerOf2() &&
 2132     if (C.isPowerOf2() &&
 2543   if (Pred == ICmpInst::ICMP_ULT && C.isPowerOf2() &&
 2549   if (Pred == ICmpInst::ICMP_UGT && (C + 1).isPowerOf2() && (*C2 & C) == C)
 2608   if (Pred == ICmpInst::ICMP_ULT && C.isPowerOf2() && (*C2 & (C - 1)) == 0)
 2615   if (Pred == ICmpInst::ICMP_UGT && (C + 1).isPowerOf2() && (*C2 & C) == 0)
 2922       if (match(BOp1, m_APInt(BOC)) && BOC->sgt(1) && BOC->isPowerOf2()) {
 2993       if (C == *BOC && C.isPowerOf2())
 3432   assert(ICmpCst.isPowerOf2());
 3435   assert(AddCst.ult(ICmpCst) && AddCst.isPowerOf2());
 4202     if (Pow2.isPowerOf2() && isa<IntegerType>(A->getType()) &&
 4617       if (CVal.isPowerOf2()) {
 5000         if (ValToCheck.isPowerOf2()) {
 5006         } else if ((++ValToCheck).isPowerOf2()) {
lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
  104   if (match(C, m_APInt(IVal)) && IVal->isPowerOf2())
  119     if (!match(Elt, m_APInt(IVal)) || !IVal->isPowerOf2())
  239       if (Val.isNegative() && PosVal.isPowerOf2()) {
 1075     if (I.isExact() && Op1C->isNonNegative() && Op1C->isPowerOf2()) {
lib/Transforms/InstCombine/InstCombineSelect.cpp
  152     if (!AndMask.isPowerOf2())
  198   if (!TC.isPowerOf2() && !FC.isPowerOf2())
  198   if (!TC.isPowerOf2() && !FC.isPowerOf2())
 2036   if (!(*MaxValue + 1).isPowerOf2() || -*MinValue != *MaxValue + 1)
lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
  607       if (RA.isPowerOf2()) {
lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
  846         if (ElementSize.isPowerOf2()) {
  907         if (ElementSize.isPowerOf2()) {
lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
  606   if (IndexOffset.isPowerOf2()) {
  611   if ((-IndexOffset).isPowerOf2()) {
lib/Transforms/Utils/SimplifyCFG.cpp
  549         if (Mask.isPowerOf2() && (C->getValue() & ~Mask) == C->getValue()) {
  572         if (Mask.isPowerOf2() && (C->getValue() | Mask) == C->getValue()) {
lib/Transforms/Utils/SimplifyLibCalls.cpp
 1527         NI > 1 && NI.isPowerOf2()) {
lib/Transforms/Vectorize/SLPVectorizer.cpp
 3126             !CInt->getValue().isPowerOf2())
tools/clang/lib/CodeGen/CGStmtOpenMP.cpp
 1540       assert((Alignment == 0 || Alignment.isPowerOf2()) &&
tools/clang/lib/Sema/SemaAttr.cpp
  303         !(Val == 0 || Val.isPowerOf2()) ||
tools/clang/lib/Sema/SemaChecking.cpp
 6038     if (!Result.isPowerOf2())
 6073     if (!Result.isPowerOf2())
tools/clang/lib/Sema/SemaDecl.cpp
17330       if (EVal.isPowerOf2())
17571       if (InitVal != 0 && !InitVal.isPowerOf2() &&
tools/clang/lib/Sema/SemaDeclAttr.cpp
 1573     if (!I.isPowerOf2()) {
 3602     if (!Alignment.isPowerOf2()) {
 3924         VectorSize.isPowerOf2()) {
tools/clang/lib/Sema/SemaOpenMP.cpp
11166   if (CKind == OMPC_aligned && !Result.isPowerOf2()) {
tools/clang/tools/extra/clang-tidy/bugprone/SuspiciousEnumUsageCheck.cpp
   66   if (Val.isPowerOf2() || !Val.getBoolValue())
tools/clang/tools/extra/clang-tidy/readability/MagicNumbersCheck.cpp
  128   if (IgnorePowersOf2IntegerValues && IntValue.isPowerOf2())
tools/polly/lib/CodeGen/IslExprBuilder.cpp
  419       if (Val.isPowerOf2() && Val.isNonNegative()) {
tools/polly/unittests/Isl/IslTest.cpp
  253     EXPECT_TRUE(APLargePow2.isPowerOf2());
  271     EXPECT_TRUE(APLargePow2.isPowerOf2());