const DominatorTree *DT) {
if (auto *CI = dyn_cast<ConstantInt>(V))
return CI->getValue().isStrictlyPositive();
-
+
// TODO: We'd doing two recursive queries here. We should factor this such
// that only a single query is needed.
return isKnownNonNegative(V, DL, Depth, AC, CxtI, DT) &&
// Check for pointer simplifications.
if (V->getType()->isPointerTy()) {
if (isKnownNonNull(V))
- return true;
+ return true;
if (GEPOperator *GEP = dyn_cast<GEPOperator>(V))
if (isGEPKnownNonNull(GEP, Depth, Q))
return true;
APInt KnownZero(BitWidth, 0);
APInt KnownOne(BitWidth, 0);
computeKnownBits(X, KnownZero, KnownOne, Depth, Q);
-
+
auto ShiftVal = Shift->getLimitedValue(BitWidth - 1);
// Is there a known one in the portion not shifted out?
if (KnownOne.countLeadingZeros() < BitWidth - ShiftVal)
return true;
case Instruction::FMul:
// x*x is always non-negative or a NaN.
- if (I->getOperand(0) == I->getOperand(1))
+ if (I->getOperand(0) == I->getOperand(1))
return true;
// Fall through
case Instruction::FAdd:
}
break;
}
- return false;
+ return false;
}
/// If the specified value can be set by repeating the same byte in memory,
return false;
return true;
-}
+}
/// This function computes the length of a null-terminated C string pointed to
/// by V. If successful, it returns true and returns the string in Str.
return !GV->hasExternalWeakLinkage() &&
GV->getType()->getAddressSpace() == 0;
- // A Load tagged w/nonnull metadata is never null.
+ // A Load tagged w/nonnull metadata is never null.
if (const LoadInst *LI = dyn_cast<LoadInst>(V))
return LI->getMetadata(LLVMContext::MD_nonnull);
const BranchInst *BI = dyn_cast<BranchInst>(CmpU);
if (!BI)
continue;
-
+
assert(BI->isConditional() && "uses a comparison!");
BasicBlock *NonNullSuccessor = nullptr;