[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 11:09:02 PDT 2018


aditya_nandakumar added a comment.

In https://reviews.llvm.org/D53594#1280672, @qcolombet wrote:

> >   This allows implicit truncation.
>
> That sounds dangerous to me.


This lets targets with say 4 x s8 legal but not s8 on it's own. Instead of writing
a(<4 x s32>) = G_BUILD_VECTOR p(s32), q, r, s
b(<4 x s8>) = G_TRUNC a

We can write this in one instruction (similar to the DAG)
b(<4 x s8>) = G_BUILD_VECTOR p, q, r, s

Without implicit truncations, it's necessary to make G_BUILD_VECTOR of <4 x s32> also legal just to make G_BUILD_VECTOR < 4 x s8> legal (though probably most targets will have 4 x s32 already legal).
Implicit truncation feels like a nice to have - I'm not strongly in favor of it. If there are good reasons to not have it, we should forbid it.


Repository:
  rL LLVM

https://reviews.llvm.org/D53594





More information about the llvm-commits mailing list