[llvm] r300607 - [LoopReroll] Prefer hasNUses/hasNUses or more as they're cheaper. NFCI.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 18 14:42:21 PDT 2017
Author: davide
Date: Tue Apr 18 16:42:21 2017
New Revision: 300607
URL: http://llvm.org/viewvc/llvm-project?rev=300607&view=rev
Log:
[LoopReroll] Prefer hasNUses/hasNUses or more as they're cheaper. NFCI.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp?rev=300607&r1=300606&r2=300607&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp Tue Apr 18 16:42:21 2017
@@ -852,7 +852,7 @@ collectPossibleRoots(Instruction *Base,
for (auto &KV : Roots) {
if (KV.first == 0)
continue;
- if (KV.second->getNumUses() != NumBaseUses) {
+ if (!KV.second->hasNUses(NumBaseUses)) {
DEBUG(dbgs() << "LRR: Aborting - Root and Base #users not the same: "
<< "#Base=" << NumBaseUses << ", #Root=" <<
KV.second->getNumUses() << "\n");
@@ -867,7 +867,7 @@ void LoopReroll::DAGRootTracker::
findRootsRecursive(Instruction *I, SmallInstructionSet SubsumedInsts) {
// Does the user look like it could be part of a root set?
// All its users must be simple arithmetic ops.
- if (I->getNumUses() > IL_MaxRerollIterations)
+ if (I->hasNUsesOrMore(IL_MaxRerollIterations + 1))
return;
if (I != IV && findRootsBase(I, SubsumedInsts))
More information about the llvm-commits
mailing list