Skip to content

Remove redundant inclusion for 0 (NFC) #151057

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

AZero13
Copy link
Contributor

@AZero13 AZero13 commented Jul 28, 2025

If Add Constant is 0, return true anyway.

@llvmbot
Copy link
Member

llvmbot commented Jul 28, 2025

@llvm/pr-subscribers-backend-aarch64

Author: AZero13 (AZero13)

Changes

If Add Constant is 0, return true anyway.


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

1 Files Affected:

  • (modified) llvm/lib/Target/AArch64/AArch64ISelLowering.cpp (+4-4)
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 7b49754ee7e1f..c030e5a3ca62b 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -24805,15 +24805,15 @@ static bool isEquivalentMaskless(unsigned CC, unsigned width,
   case AArch64CC::GT:
     if ((AddConstant == 0) ||
         (CompConstant == MaxUInt - 1 && AddConstant < 0) ||
-        (AddConstant >= 0 && CompConstant < 0) ||
-        (AddConstant <= 0 && CompConstant <= 0 && CompConstant < AddConstant))
+        (AddConstant > 0 && CompConstant < 0) ||
+        (AddConstant < 0 && CompConstant <= 0 && CompConstant < AddConstant))
       return true;
     break;
   case AArch64CC::LT:
   case AArch64CC::GE:
     if ((AddConstant == 0) ||
-        (AddConstant >= 0 && CompConstant <= 0) ||
-        (AddConstant <= 0 && CompConstant <= 0 && CompConstant <= AddConstant))
+        (AddConstant > 0 && CompConstant <= 0) ||
+        (AddConstant < 0 && CompConstant <= 0 && CompConstant <= AddConstant))
       return true;
     break;
   case AArch64CC::HI:

Copy link

github-actions bot commented Jul 28, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

If Add Constant is 0, return true anyway.
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.

2 participants