Skip to content

[NFC][llvm/IR] comparison of unsigned expression in ‘>= 0’ is always true #130843

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
Mar 14, 2025

Conversation

hiraditya
Copy link
Collaborator

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Mar 11, 2025

@llvm/pr-subscribers-llvm-ir

Author: AdityaK (hiraditya)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/IR/AutoUpgrade.cpp (+1-1)
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index cb4ecc60aa473..97cb91bb402c1 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -5044,7 +5044,7 @@ static void upgradeNVVMFnVectorAttr(const StringRef Attr, const char DimC,
   }
 
   const unsigned Dim = DimC - 'x';
-  assert(Dim >= 0 && Dim < 3 && "Unexpected dim char");
+  assert(Dim < 3 && "Unexpected dim char");
 
   const uint64_t VInt = mdconst::extract<ConstantInt>(V)->getZExtValue();
 

Copy link
Member

@AlexMaclean AlexMaclean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hiraditya hiraditya merged commit b17af9d into llvm:main Mar 14, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants