getNumUses() can be more expensive as it iterates over all list's elements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300558
91177308-0d34-0410-b5e6-
96231b3b80d8
Instruction *UUser = dyn_cast<Instruction>(UU);
// Skip SExt if we are extending an nsw value
// TODO: Allow ZExt too
- if (BO->hasNoSignedWrap() && UUser && UUser->getNumUses() == 1 &&
+ if (BO->hasNoSignedWrap() && UUser && UUser->hasOneUse() &&
isa<SExtInst>(UUser))
UUser = dyn_cast<Instruction>(*(UUser->user_begin()));
if (!isCompareUsedByBranch(UUser))