aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2022-08-09 16:42:10 +0100
committerSimon Pilgrim <llvm-dev@redking.me.uk>2022-08-09 16:42:19 +0100
commited162d455a6585a75290c60c934b2a514ac55747 (patch)
treeaeac90d62f3f35d2aad2dbbda22ac71cb993b556
parentee27bca2e2c75593e0d794ba23e054af319d04c7 (diff)
downloadllvm-ed162d455a6585a75290c60c934b2a514ac55747.zip
llvm-ed162d455a6585a75290c60c934b2a514ac55747.tar.gz
llvm-ed162d455a6585a75290c60c934b2a514ac55747.tar.bz2
[DAG] Avoid hasOneUse() calls if the cheaper !AssumeSingleUse test has already failed. NFC.
Very minor optimization, but every little helps..
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp4
1 files 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.