Skip to content

ARM: Remove unnecessary use_empty check #137338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Apr 25, 2025

The previous statement removed all uses.

Copy link
Contributor Author

arsenm commented Apr 25, 2025

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

@arsenm arsenm marked this pull request as ready for review April 25, 2025 14:21
@llvmbot
Copy link
Member

llvmbot commented Apr 25, 2025

@llvm/pr-subscribers-backend-arm

Author: Matt Arsenault (arsenm)

Changes

The previous statement removed all uses.


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

1 Files Affected:

  • (modified) llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp (+1-2)
diff --git a/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp b/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
index e998359bd3496..ce59ae0c95dcf 100644
--- a/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
+++ b/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
@@ -1099,8 +1099,7 @@ bool MVEGatherScatterLowering::optimiseOffsets(Value *Offsets, BasicBlock *BB,
 
   // The instruction has now been "absorbed" into the phi value
   Offs->replaceAllUsesWith(NewPhi);
-  if (Offs->use_empty())
-    Offs->eraseFromParent();
+  Offs->eraseFromParent();
   // Clean up the old increment in case it's unused because we built a new
   // one
   if (IncInstruction->use_empty())

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:32 AM EDT: Graphite rebased this pull request as part of a merge.
  • Apr 25, 11:34 AM EDT: @arsenm merged this pull request with Graphite.

@arsenm arsenm force-pushed the users/arsenm/arm/use-empty-not-hasNUses-0 branch 2 times, most recently from e676b30 to 8d410ef Compare April 25, 2025 15:28
Base automatically changed from users/arsenm/arm/use-empty-not-hasNUses-0 to main April 25, 2025 15:31
The previous statement removed all uses.
@arsenm arsenm force-pushed the users/arsenm/arm/remove-use-empty-check branch from c62d35f to dc226e3 Compare April 25, 2025 15:32
@arsenm arsenm merged commit 6b3289f into main Apr 25, 2025
6 of 9 checks passed
@arsenm arsenm deleted the users/arsenm/arm/remove-use-empty-check branch April 25, 2025 15:34
jyli0116 pushed a commit to jyli0116/llvm-project that referenced this pull request Apr 28, 2025
The previous statement removed all uses.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
The previous statement removed all uses.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
The previous statement removed all uses.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
The previous statement removed all uses.
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request May 9, 2025
The previous statement removed all uses.
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.

3 participants