From ed162d455a6585a75290c60c934b2a514ac55747 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 9 Aug 2022 16:42:10 +0100 Subject: [PATCH] [DAG] Avoid hasOneUse() calls if the cheaper !AssumeSingleUse test has already failed. NFC. Very minor optimization, but every little helps.. --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index afdbbd8..f4f952d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -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; @@ -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. -- 2.7.4