[llvm] eaf911b - [InstCombine] Fix comment typo that incorrectly described fold (NFC) (#141105)
via llvm-commits
llvm-commits at lists.llvm.org
Thu May 22 11:28:48 PDT 2025
Author: AZero13
Date: 2025-05-22T20:28:45+02:00
New Revision: eaf911bb98509e47b35376ffbc800dca6c803793
URL: https://github.com/llvm/llvm-project/commit/eaf911bb98509e47b35376ffbc800dca6c803793
DIFF: https://github.com/llvm/llvm-project/commit/eaf911bb98509e47b35376ffbc800dca6c803793.diff
LOG: [InstCombine] Fix comment typo that incorrectly described fold (NFC) (#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.
Added:
Modified:
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
Removed:
################################################################################
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()) {
More information about the llvm-commits
mailing list