Skip to content

[InstCombine] Fix comment typo that incorrectly described fold (NFC) #141105

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
May 22, 2025

Conversation

AZero13
Copy link
Contributor

@AZero13 AZero13 commented May 22, 2025

icmp ne X, (sext (icmp ne X, 0)) --> X != 0 && X != -1, not X != 0 && X == -1, which would go to X == -1 anyway.

@AZero13 AZero13 requested a review from nikic as a code owner May 22, 2025 17:19
@AZero13 AZero13 changed the title [InstCombine] Fix comment typo [InstCombine] Fix comment typo (NFC) May 22, 2025
@llvmbot llvmbot added llvm:instcombine Covers the InstCombine, InstSimplify and AggressiveInstCombine passes llvm:transforms labels May 22, 2025
@llvmbot
Copy link
Member

llvmbot commented May 22, 2025

@llvm/pr-subscribers-llvm-transforms

Author: AZero13 (AZero13)

Changes

icmp ne X, (sext (icmp ne X, 0)) --> X != 0 && X != -1, not X != 0 && X == -1, which would go to X == -1 anyway.


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp (+1-1)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 00b0f05f18f03..bdc7a49700cfc 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -7078,7 +7078,7 @@ Instruction *InstCombinerImpl::foldICmpUsingBoolRange(ICmpInst &I) {
         // icmp eq X, (zext (icmp ne X, 0)) --> X == 0 || X == 1
         // icmp ne X, (zext (icmp ne X, 0)) --> X != 0 && X != 1
         // icmp eq X, (sext (icmp ne X, 0)) --> X == 0 || X == -1
-        // icmp ne X, (sext (icmp ne X, 0)) --> X != 0 && X == -1
+        // icmp ne X, (sext (icmp ne X, 0)) --> X != 0 && X != -1
         return CreateRangeCheck();
       }
     } else if (IsSExt ? C->isAllOnes() : C->isOne()) {

@AZero13 AZero13 changed the title [InstCombine] Fix comment typo (NFC) [InstCombine] Fix comment typo that incorrectly described fold (NFC) May 22, 2025
icmp ne X, (sext (icmp ne X, 0)) --> X != 0 && X != -1, not X != 0 && X == -1, which would go to X == -1 anyway.
@AZero13
Copy link
Contributor Author

AZero13 commented May 22, 2025

@arsenm I cannot merge. Can you please do this?

@arsenm arsenm merged commit eaf911b into llvm:main May 22, 2025
7 of 9 checks passed
@AZero13 AZero13 deleted the typo branch May 22, 2025 18:31
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
…lvm#141105)

icmp ne X, (sext (icmp ne X, 0)) --> X != 0 && X != -1, not X != 0 && X
== -1, which would go to X == -1 anyway.
ajaden-codes pushed a commit to Jaddyen/llvm-project that referenced this pull request Jun 6, 2025
…lvm#141105)

icmp ne X, (sext (icmp ne X, 0)) --> X != 0 && X != -1, not X != 0 && X
== -1, which would go to X == -1 anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:instcombine Covers the InstCombine, InstSimplify and AggressiveInstCombine passes llvm:transforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants