Skip to content

Commit

Permalink
[DAG] Avoid hasOneUse() calls if the cheaper !AssumeSingleUse test ha…
Browse files Browse the repository at this point in the history
…s already failed. NFC.

Very minor optimization, but every little helps..
  • Loading branch information
RKSimon committed Aug 9, 2022
1 parent ee27bca commit ed162d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Expand Up @@ -1107,7 +1107,7 @@ bool TargetLowering::SimplifyDemandedBits(

// Other users may use these bits.
bool HasMultiUse = false;
if (!Op.getNode()->hasOneUse() && !AssumeSingleUse) {
if (!AssumeSingleUse && !Op.getNode()->hasOneUse()) {
if (Depth >= SelectionDAG::MaxRecursionDepth) {
// Limit search depth.
return false;
Expand Down Expand Up @@ -2827,7 +2827,7 @@ bool TargetLowering::SimplifyDemandedVectorElts(
}

// If Op has other users, assume that all elements are needed.
if (!Op.getNode()->hasOneUse() && !AssumeSingleUse)
if (!AssumeSingleUse && !Op.getNode()->hasOneUse())
DemandedElts.setAllBits();

// Not demanding any elements from Op.
Expand Down

0 comments on commit ed162d4

Please sign in to comment.