Skip to content

[InstCombine] Fix comment from #88193 (NFC) #91427

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 9, 2024
Merged

Conversation

AZero13
Copy link
Contributor

@AZero13 AZero13 commented May 8, 2024

It is inaccurate and needs to be corrected.

@AZero13 AZero13 requested a review from nikic as a code owner May 8, 2024 03:17
@AZero13 AZero13 changed the title [InstCombine] Fix comment from #88193 [InstCombine] Fix comment from #88193 (NFC) May 8, 2024
@llvmbot
Copy link
Member

llvmbot commented May 8, 2024

@llvm/pr-subscribers-llvm-transforms

Author: AtariDreams (AtariDreams)

Changes

It is inaccurate and needs to be corrected.


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp (+2-2)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
index 8847de366713..a670efe3caa5 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
@@ -1259,7 +1259,7 @@ Instruction *InstCombinerImpl::visitLShr(BinaryOperator &I) {
       match(Op1, m_SpecificIntAllowPoison(BitWidth - 1)))
     return new ZExtInst(Builder.CreateIsNotNeg(X, "isnotneg"), Ty);
 
-  // ((X << nuw Z) sub nuw Y) >>u exact Z --> X sub nuw (Y >>u exact Z),
+  // ((X << nuw Z) sub nuw Y) >>u exact Z --> X sub nuw (Y >>u exact Z)
   Value *Y;
   if (I.isExact() &&
       match(Op0, m_OneUse(m_NUWSub(m_NUWShl(m_Value(X), m_Specific(Op1)),
@@ -1279,7 +1279,7 @@ Instruction *InstCombinerImpl::visitLShr(BinaryOperator &I) {
     case Instruction::And:
     case Instruction::Or:
     case Instruction::Xor:
-      // And does not work here, and sub is handled separately.
+      // Sub is handled separately
       return true;
     }
   };

It is inaccurate and needs to be corrected.
@nikic nikic merged commit 409ff97 into llvm:main May 9, 2024
@AZero13 AZero13 deleted the comment-fix branch May 9, 2024 12:03
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