From 40240a1e6be1ae6e19d244152df5293d2f91f10c Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Tue, 16 May 2017 22:38:40 +0000 Subject: [PATCH] [IR] Prefer use_empty() to !hasNUsesOrMore(1) for clarity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303218 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LICM.cpp | 2 +- lib/Transforms/Scalar/Reassociate.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index 340c81fed0f..37b9c4b1094 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -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(II->getArgOperand(0))->getSExtValue() * 8; diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index ef29d414160..53320bff088 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -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(User) || !User->hasNUsesOrMore(1)) + if (!isa(User) || User->use_empty()) return nullptr; unsigned UserOpcode = User->getOpcode(); -- 2.50.1