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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 08:18:17 PDT 2019


spatel added a comment.

In D66095#1631501 <https://reviews.llvm.org/D66095#1631501>, @ABataev wrote:

> In D66095#1631495 <https://reviews.llvm.org/D66095#1631495>, @spatel wrote:
>
> > In D66095#1630408 <https://reviews.llvm.org/D66095#1630408>, @ABataev wrote:
> >
> > > What about very long vectors that do no fit into single register? Is it cost effective for such vectors too?
> >
> >
> > We would split the long vectors into values that fit the target registers in the backend. At that point, the target can decide if N vector selects are better or worse than a transfer to scalar compare and branch. As @lebedev.ri mentioned, we're missing that logic in SDAG, but given that this transform produces the better code for the default case, I don't think we need to make this patch dependent on backend fixups.
>
>
> But it adds extra cost for vectors splitting. Maybe limit the size of the vectors in the patch?


How would we do that? This is canonicalization, so we are not using any target-dependent information here. Presumably, whoever or whatever created the illegal vectors in the first place knows that codegen will have to alter the those ops to create legal code, so that will be handled by a pass that has a cost model.


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

https://reviews.llvm.org/D66095





More information about the llvm-commits mailing list