Skip to content

Commit

Permalink
[NARY][NFC] Use hasNUsesOrMore instead of getNumUses since it's more
Browse files Browse the repository at this point in the history
efficient.
  • Loading branch information
Evgeniy Brevnov committed Apr 13, 2021
1 parent a6628e5 commit e50aa1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Scalar/NaryReassociate.cpp
Expand Up @@ -592,7 +592,7 @@ Value *NaryReassociatePass::tryReassociateMinOrMax(Instruction *I,
Value *A = nullptr, *B = nullptr;
MaxMinT m_MaxMin(m_Value(A), m_Value(B));
for (unsigned int i = 0; i < 2; ++i) {
if (LHS->getNumUses() <= 2 && match(LHS, m_MaxMin)) {
if (!LHS->hasNUsesOrMore(3) && match(LHS, m_MaxMin)) {
const SCEV *AExpr = SE->getSCEV(A), *BExpr = SE->getSCEV(B);
const SCEV *RHSExpr = SE->getSCEV(RHS);
for (unsigned int j = 0; j < 2; ++j) {
Expand Down

0 comments on commit e50aa1a

Please sign in to comment.