[llvm] r303218 - [IR] Prefer use_empty() to !hasNUsesOrMore(1) for clarity.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Tue May 16 15:38:41 PDT 2017
Author: davide
Date: Tue May 16 17:38:40 2017
New Revision: 303218
URL: http://llvm.org/viewvc/llvm-project?rev=303218&view=rev
Log:
[IR] Prefer use_empty() to !hasNUsesOrMore(1) for clarity.
Modified:
llvm/trunk/lib/Transforms/Scalar/LICM.cpp
llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=303218&r1=303217&r2=303218&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Tue May 16 17:38:40 2017
@@ -546,7 +546,7 @@ static bool isLoadInvariantInLoop(LoadIn
// 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;
Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=303218&r1=303217&r2=303218&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Tue May 16 17:38:40 2017
@@ -1922,7 +1922,7 @@ Instruction *ReassociatePass::canonicali
// 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();
More information about the llvm-commits
mailing list