[PATCH] D118317: [InstCombine] Fold and-reduce idiom

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 08:02:47 PST 2022


spatel added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/icmp-vec.ll:431
 
 define i1 @eq_cast_ne-1(<2 x i7> %x, <2 x i7> %y) {
 ; CHECK-LABEL: @eq_cast_ne-1(
----------------
mkazantsev wrote:
> mkazantsev wrote:
> > spatel wrote:
> > > If this had a power-of-2 type with this pattern, would we handle it? Would be good to add a few more test comments, so the intent is clear.
> > > https://alive2.llvm.org/ce/z/rDeaif
> > > 
> > > 
> > Yup. It was going to make this as 2nd step of this activity and support or-base `ne` pattern.
> I mean, it's a slightly different pattern with `-1` in the original cmp, but we can support it in a very similar manner.
I think we'll always canonicalize it to a 0 constant (as shown in the current CHECK lines) - only the predicate is different, so it would be a very small adjustment to make this work?


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

https://reviews.llvm.org/D118317



More information about the llvm-commits mailing list