forked from OSchip/llvm-project
[IR] Prefer use_empty() to !hasNUsesOrMore(1) for clarity.
llvm-svn: 303218
This commit is contained in:
parent
65699e5e7d
commit
79eb3b0366
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue