[llvm-branch-commits] [llvm] ARM: Avoid using getNumUses (PR #136355)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Apr 18 12:25:04 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-arm
Author: Matt Arsenault (arsenm)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/136355.diff
1 Files Affected:
- (modified) llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp (+3-3)
``````````diff
diff --git a/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp b/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
index 7efd2989aa7fa..b97ad5ad5e9ee 100644
--- a/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
+++ b/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
@@ -808,7 +808,7 @@ Instruction *MVEGatherScatterLowering::tryCreateIncrementingWBGatScat(
// by a constant, thus we're looking for an add of a phi and a constant
PHINode *Phi = dyn_cast<PHINode>(Offsets);
if (Phi == nullptr || Phi->getNumIncomingValues() != 2 ||
- Phi->getParent() != L->getHeader() || Phi->getNumUses() != 2)
+ Phi->getParent() != L->getHeader() || !Phi->hasNUses(2))
// No phi means no IV to write back to; if there is a phi, we expect it
// to have exactly two incoming values; the only phis we are interested in
// will be loop IV's and have exactly two uses, one in their increment and
@@ -1051,10 +1051,10 @@ bool MVEGatherScatterLowering::optimiseOffsets(Value *Offsets, BasicBlock *BB,
// If the phi is not used by anything else, we can just adapt it when
// replacing the instruction; if it is, we'll have to duplicate it
PHINode *NewPhi;
- if (Phi->getNumUses() == 2) {
+ if (Phi->hasNUses(2)) {
// No other users -> reuse existing phi (One user is the instruction
// we're looking at, the other is the phi increment)
- if (IncInstruction->getNumUses() != 1) {
+ if (!IncInstruction->hasOneUse()) {
// If the incrementing instruction does have more users than
// our phi, we need to copy it
IncInstruction = BinaryOperator::Create(
``````````
</details>
https://github.com/llvm/llvm-project/pull/136355
More information about the llvm-branch-commits
mailing list