[llvm] [InstCombine] Extend `foldICmpBinOp` to `add`-like `or`. (PR #71396)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 01:08:40 PST 2023


================
@@ -3862,10 +3862,9 @@ define <8 x i1> @bitreverse_vec_ne(<8 x i16> %x, <8 x i16> %y) {
 define i1 @knownbits1(i8 %a, i8 %b) {
 ; CHECK-LABEL: @knownbits1(
 ; CHECK-NEXT:    [[A1:%.*]] = and i8 [[A:%.*]], 1
-; CHECK-NEXT:    [[A2:%.*]] = or disjoint i8 [[A1]], 4
 ; CHECK-NEXT:    [[B1:%.*]] = and i8 [[B:%.*]], 2
-; CHECK-NEXT:    [[B2:%.*]] = or disjoint i8 [[B1]], 5
-; CHECK-NEXT:    [[C:%.*]] = icmp eq i8 [[A2]], [[B2]]
----------------
nikic wrote:

All of these tests are canonicalized into a form using equality predicates. Can you add some tests where we're actually working with a non-equality predicate, so that the logic around nowrap flags is exercised?

https://github.com/llvm/llvm-project/pull/71396


More information about the llvm-commits mailing list