[IR] Prefer use_empty() to !hasNUsesOrMore(1) for clarity.

llvm-svn: 303218
This commit is contained in:
Davide Italiano 2017-05-16 22:38:40 +00:00
parent 65699e5e7d
commit 79eb3b0366
2 changed files with 2 additions and 2 deletions

View File

@ -546,7 +546,7 @@ static bool isLoadInvariantInLoop(LoadInst *LI, DominatorTree *DT,
// If there are escaping uses of invariant.start instruction, the load maybe
// non-invariant.
if (!II || II->getIntrinsicID() != Intrinsic::invariant_start ||
II->hasNUsesOrMore(1))
!II->use_empty())
continue;
unsigned InvariantSizeInBits =
cast<ConstantInt>(II->getArgOperand(0))->getSExtValue() * 8;

View File

@ -1922,7 +1922,7 @@ Instruction *ReassociatePass::canonicalizeNegConstExpr(Instruction *I) {
// User must be a binary operator with one or more uses.
Instruction *User = I->user_back();
if (!isa<BinaryOperator>(User) || !User->hasNUsesOrMore(1))
if (!isa<BinaryOperator>(User) || User->use_empty())
return nullptr;
unsigned UserOpcode = User->getOpcode();