[PATCH] D151694: [InstCombine] Add test case for (icmp eq A, -1) & (icmp eq B, -1) --> (icmp eq (A&B), -1); NFC

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 10:19:39 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/and-or-icmps.ll:2498
+
+define <2 x i1> @icmp_eq_m1_and_eq_m1(<2 x i8> %x, <2 x i8> %y) {
+; CHECK-LABEL: @icmp_eq_m1_and_eq_m1(
----------------
Can you add a negative test of this with the following inputs:
```
  %rx = icmp eq <2 x i8> %x, <i8 -1, i8 undef>
  %ry = icmp eq <2 x i8> %y, <i8 undef, i8 -1>
```

and

```
  %rx = icmp eq <2 x i8> %x, <i8 undef, i8 undef>
  %ry = icmp eq <2 x i8> %y, <i8 -1, i8 -2>
```


================
Comment at: llvm/test/Transforms/InstCombine/and-or-icmps.ll:2548
+  %rx = icmp ne <2 x i8> %x, <i8 -1, i8 undef>
+  %ry = icmp ne <2 x i8> %y, <i8 -1, i8 undef>
+  %r = or <2 x i1> %rx, %ry
----------------
make `rx` here `-1, -1`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151694/new/

https://reviews.llvm.org/D151694



More information about the llvm-commits mailing list