[InstCombine] Fold icmp x, ~x and icmp ~x, x by testing the sign
Fixes #57532.
Examples:
https://alive2.llvm.org/ce/z/XBj9Pf
https://alive2.llvm.org/ce/z/UNkucP
Paths
| Differential D133328
[InstCombine] Fold icmp x, ~x and icmp ~x, x by testing the sign Needs ReviewPublic Authored by tianz on Sep 5 2022, 3:47 PM.
Details Summary [InstCombine] Fold icmp x, ~x and icmp ~x, x by testing the sign Fixes #57532. Examples:
Diff Detail Event TimelineComment Actions The predicate check is too restrictive. We can handle unsigned preds too:
Revision Contents
Diff 463421 llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp-not.ll
|
please don't enumerate tests - chose a name that describes the pattern + any specific constant you're using