[PATCH] D66095: [InstCombine] canonicalize a scalar-select-of-vectors to vector select

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 14:50:41 PDT 2019


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

In D66095#1627478 <https://reviews.llvm.org/D66095#1627478>, @spatel wrote:

> In D66095#1627455 <https://reviews.llvm.org/D66095#1627455>, @lebedev.ri wrote:
>
> > I'm honestly not sure here if i would consider splat-of-i1 or i1 more canonical,
> >  i would kind-of guessed i1 since it is a single bit while vector isn't.
>
>
> Yes, I can see that argument.




> However, if we consider the i1 canonical, then we need to reverse this patch +

True.

> add the codegen fixup

To be noted, that codegen fix is wanted regardless.

> + make sure that IR transforms based on vector splat patterns can match that potential variation of the pattern.

I don't have any good grasp to guess what those would be.

> That seems like a lot more work than what we have here: try to convert a select with vector true/false operands to also have a vector condition because we know that plays nicely with vector code in general.

I just feel like pointing out that it is the case because we don't do said opposite transform (select based on splat -> select-of-vecs) in dagcombine as of now.
But yeah, i suspect this may be more canonical; e.g. on x86 there is no `i128` blend, only `<? X ?>` blends.

Looks ok to me, but would be good for someone else to double-check.


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

https://reviews.llvm.org/D66095





More information about the llvm-commits mailing list