[llvm] ARM: Avoid using getNumUses (PR #136355)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 18 14:27:02 PDT 2025
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/136355
>From fe3ec0005daad35d64dc71b7289bede87b7bd648 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Fri, 18 Apr 2025 19:23:26 +0200
Subject: [PATCH] ARM: Avoid using getNumUses
---
llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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(
More information about the llvm-commits
mailing list