Skip to content

Conversation

@arsenm
Copy link
Contributor

@arsenm arsenm commented Apr 25, 2025

No description provided.

@arsenm arsenm marked this pull request as ready for review April 25, 2025 14:15
Copy link
Contributor Author

arsenm commented Apr 25, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@llvmbot
Copy link
Member

llvmbot commented Apr 25, 2025

@llvm/pr-subscribers-backend-arm

Author: Matt Arsenault (arsenm)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/137337.diff

1 Files Affected:

  • (modified) llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp (+3-3)
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;

Copy link
Contributor Author

arsenm commented Apr 25, 2025

Merge activity

  • Apr 25, 11:24 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Apr 25, 11:27 AM EDT: Graphite rebased this pull request as part of a merge.
  • Apr 25, 11:29 AM EDT: Graphite rebased this pull request as part of a merge.
  • Apr 25, 11:31 AM EDT: @arsenm merged this pull request with Graphite.

@arsenm arsenm force-pushed the users/arsenm/arm/use-empty-not-hasNUses-0 branch from 78e9635 to e676b30 Compare April 25, 2025 15:26
@arsenm arsenm force-pushed the users/arsenm/arm/use-empty-not-hasNUses-0 branch from e676b30 to 8d410ef Compare April 25, 2025 15:29
@arsenm arsenm merged commit 50a767a into main Apr 25, 2025
6 of 10 checks passed
@arsenm arsenm deleted the users/arsenm/arm/use-empty-not-hasNUses-0 branch April 25, 2025 15:31
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants