[llvm] 50a767a - ARM: Use use_empty instead of hasNUses(0) (#137337)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 25 08:31:50 PDT 2025


Author: Matt Arsenault
Date: 2025-04-25T17:31:46+02:00
New Revision: 50a767add148601a1494760d02e237fe5cc57555

URL: https://github.com/llvm/llvm-project/commit/50a767add148601a1494760d02e237fe5cc57555
DIFF: https://github.com/llvm/llvm-project/commit/50a767add148601a1494760d02e237fe5cc57555.diff

LOG: ARM: Use use_empty instead of hasNUses(0) (#137337)

Added: 
    

Modified: 
    llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp

Removed: 
    


################################################################################
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