[llvm] 559a50c - SimplifyIndVar: Use use_empty instead of hasNUses(0) (#137346)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 25 10:11:43 PDT 2025
Author: Matt Arsenault
Date: 2025-04-25T19:11:39+02:00
New Revision: 559a50c5f0b71d5ba91650fe9122f046403808ed
URL: https://github.com/llvm/llvm-project/commit/559a50c5f0b71d5ba91650fe9122f046403808ed
DIFF: https://github.com/llvm/llvm-project/commit/559a50c5f0b71d5ba91650fe9122f046403808ed.diff
LOG: SimplifyIndVar: Use use_empty instead of hasNUses(0) (#137346)
Added:
Modified:
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
index 03dbf9513d140..e6ee2e06cafab 100644
--- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
@@ -2085,7 +2085,7 @@ PHINode *WidenIV::createWideIV(SCEVExpander &Rewriter) {
// if the cast node is an inserted instruction without any user, we should
// remove it to make sure the pass don't touch the function as we can not
// wide the phi.
- if (ExpandInst->hasNUses(0) &&
+ if (ExpandInst->use_empty() &&
Rewriter.isInsertedInstruction(cast<Instruction>(ExpandInst)))
DeadInsts.emplace_back(ExpandInst);
return nullptr;
More information about the llvm-commits
mailing list