Skip to content

Commit

Permalink
[LoopReroll] Prefer hasNUses/hasNUses or more as they're cheaper. NFCI.
Browse files Browse the repository at this point in the history
llvm-svn: 300607
  • Loading branch information
dcci committed Apr 18, 2017
1 parent 09a88f3 commit 80fe987
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Scalar/LoopRerollPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ collectPossibleRoots(Instruction *Base, std::map<int64_t,Instruction*> &Roots) {
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");
Expand All @@ -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))
Expand Down

0 comments on commit 80fe987

Please sign in to comment.