From: Davide Italiano Date: Tue, 18 Apr 2017 21:42:21 +0000 (+0000) Subject: [LoopReroll] Prefer hasNUses/hasNUses or more as they're cheaper. NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b4630581a4f9bef8ca7fe45fb7c01c13add1393;p=llvm [LoopReroll] Prefer hasNUses/hasNUses or more as they're cheaper. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300607 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopRerollPass.cpp b/lib/Transforms/Scalar/LoopRerollPass.cpp index d54ad58fe1d..fd15a9014de 100644 --- a/lib/Transforms/Scalar/LoopRerollPass.cpp +++ b/lib/Transforms/Scalar/LoopRerollPass.cpp @@ -852,7 +852,7 @@ collectPossibleRoots(Instruction *Base, std::map &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"); @@ -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))