From e50aa1af2d3b8c8d428734bb1752ec45bcc0eb33 Mon Sep 17 00:00:00 2001 From: Evgeniy Brevnov Date: Tue, 13 Apr 2021 08:22:35 +0700 Subject: [PATCH] [NARY][NFC] Use hasNUsesOrMore instead of getNumUses since it's more efficient. --- llvm/lib/Transforms/Scalar/NaryReassociate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Scalar/NaryReassociate.cpp b/llvm/lib/Transforms/Scalar/NaryReassociate.cpp index e352bfd..2284142 100644 --- a/llvm/lib/Transforms/Scalar/NaryReassociate.cpp +++ b/llvm/lib/Transforms/Scalar/NaryReassociate.cpp @@ -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) { -- 2.7.4