[llvm-dev] [SVE][AArch64] Codegen for a scalable vector splat
Cameron McInally via llvm-dev
llvm-dev at lists.llvm.org
Thu Aug 29 07:05:02 PDT 2019
On Thu, Aug 29, 2019 at 9:00 AM Renato Golin via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> On Thu, 29 Aug 2019 at 13:27, Graham Hunter via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > 1) Add a new SPLAT_VECTOR ISD node. This was part of our overall RFC
> from 2016 and is the solution that we're currently using downstream. It
> just accepts a single scalar value. This has worked well with just the SVE
> codegen using it, but I don't know if we would run into problems if we try
> to make this the canonical splat form for SDAG.
> >
> > 2) Extend BUILD_VECTOR to accept an initial boolean indicating whether
> it is a splat, and if true the first element can be assumed to be the same
> as all others. The splat form would be the only valid use of BUILD_VECTOR
> for scalable vector types. For fixed length vectors we could either change
> existing checks for splats to only look at the flag and would only need one
> extra argument for the splat value, or use the flag as a shortcut and fall
> back to checking all the elements if there's the possibility of a fold
> generating a splat and it not being recognised.
>
> Hi Graham,
>
> I'm not a big fan of boolean flags on related concepts because the API
> becomes brittle. In this case, BUILD_VECTOR-splat would need an assert
> to make sure there's only one element.
>
Agreed. #1 is better.
The Complex proposal requires special uses of broadcasts. Hopefully someone
from that project can comment here. It would be nice to design Complex
support into SPLAT_VECTOR, so that special lowerings aren't needed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190829/d79e74c3/attachment.html>
More information about the llvm-dev
mailing list