[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
Tue May 30 09:54:21 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/pr62311.ll:297
+lor.end:                                          ; preds = %lor.rhs, %entry
+  %0 = phi i1 [ true, %entry ], [ %cmp19, %lor.rhs ]
+  ret i1 %0
----------------
Personally, think all of these test cases are more complex than what we need.

Something simple like:
```
define i1 @icmp_eq_m1_and_eq_m1(i8 %x, i8 %y) {
  %rx = icmp eq i8 %x, -1
  %ry = icmp eq i8 %y, -1
  %r = and i1 %rx, %ry
  ret i1 %r
}
```

Is probably more inline with what we want. One more thing. Can you please postfix "_fail" to all the negative tests so it clear to the reader.

Also can you rename the file to give it a more descriptive name. Maybe something like:
`and-or-icmp-equality.ll` or you could just put these tests in `and-or-icmps.ll`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151694



More information about the llvm-commits mailing list