[PATCH] D53594: [GlobalISel] Introduce G_BUILD_VECTOR and G_CONCAT_VECTOR opcodes

Aditya Nandakumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 30 16:28:16 PDT 2018


aditya_nandakumar added a comment.

In https://reviews.llvm.org/D53594#1281508, @aemerson wrote:

> In https://reviews.llvm.org/D53594#1280811, @qcolombet wrote:
>
> > Thanks @aditya_nandakumar for the context.
> >
> > I understand where you're coming from.
> >
> > What I meant is that I would rather have one opcode of build_vector and one for build_vector with trunc. The rationale is that it makes it clear what you want to achieve and it makes for a stronger type verifier.
>
>
> I'm not sure how this is any better. If we had an opcode G_BUILD_VECTOR_TRUNC, it would have a superset of the functionality of the G_BUILD_VECTOR. You'd still have this powerful opcode, except now you have potential code duplication in handling the two, as well as a hindered G_BUILD_VECTOR.
>
> Unless you're say that G_BUILD_VECTOR _TRUNC can *only* deal with oversize scalars, in which case it's an odd opcode for a corner case (and I would suggest here that we just deal with the inconvenient types, but I'm not married to the idea).


I was under the impression that the G_BUILD_VECTOR_TRUNC would only deal with the special case of oversize scalars (and not the regular BUILD_VECTOR). You're right that we're just pushing complexity from checking types in G_BUILD_VECTOR to checking opcodes for truncating behavior. However because the trunc version probably (a big assumption) shows up a fraction of the time, it might be easier to write legalization/combines for G_BUILD_VECTOR without checking for corner cases in most places, and only deal with the corner case explicitly. That said, if there are patterns using G_BUILD_VECTOR from the DAG that rely on truncating behavior, importing it might be difficult.


Repository:
  rL LLVM

https://reviews.llvm.org/D53594





More information about the llvm-commits mailing list