[llvm] ARM: Use use_empty instead of hasNUses(0) (PR #137337)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 25 07:16:00 PDT 2025
https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/137337
None
>From 78e9635faf4987ccc25f7a053cf5a7f85ed20f62 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Fri, 25 Apr 2025 15:56:46 +0200
Subject: [PATCH] ARM: Use use_empty instead of hasNUses(0)
---
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 b97ad5ad5e9ee..e998359bd3496 100644
--- a/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
+++ b/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
@@ -944,7 +944,7 @@ void MVEGatherScatterLowering::pushOutMulShl(unsigned Opcode, PHINode *&Phi,
// Check whether all usages of this instruction are as offsets of
// gathers/scatters or simple arithmetics only used by gathers/scatters
static bool hasAllGatScatUsers(Instruction *I, const DataLayout &DL) {
- if (I->hasNUses(0)) {
+ if (I->use_empty()) {
return false;
}
bool Gatscat = true;
@@ -1099,11 +1099,11 @@ bool MVEGatherScatterLowering::optimiseOffsets(Value *Offsets, BasicBlock *BB,
// The instruction has now been "absorbed" into the phi value
Offs->replaceAllUsesWith(NewPhi);
- if (Offs->hasNUses(0))
+ if (Offs->use_empty())
Offs->eraseFromParent();
// Clean up the old increment in case it's unused because we built a new
// one
- if (IncInstruction->hasNUses(0))
+ if (IncInstruction->use_empty())
IncInstruction->eraseFromParent();
return true;
More information about the llvm-commits
mailing list