[PATCH] D68309: GlobalISel: Implement widenScalar for G_INSERT_VECTOR_ELT

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 16:40:23 PDT 2019


arsenm added a comment.

In D68309#1699422 <https://reviews.llvm.org/D68309#1699422>, @nhaehnle wrote:

> For the vector itself and the inserted element, shouldn't this be using G_ANYEXT instead? Looking at the corresponding test, the G_SHL/G_ASHR on $vgpr0 should be unnecessary based on the original code.
>
> For the element index, shouldn't this be using G_ZEXT or G_ANYEXT? I don't recall whether `insertelement` is supposed to interpret this argument as a signed or unsigned integer, and couldn't quickly find a reference to it. Not that it usually matters, but I find G_SEXT here surprising as well.


I was just copying what the extract does. Signed doesn't particularly make sense because a negative index would be an undefined / out of bounds result


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

https://reviews.llvm.org/D68309





More information about the llvm-commits mailing list