[PATCH] D132978: [CodeGen] Using ZExt for extractelement indices.

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 07:24:33 PDT 2022


reames added a comment.

As a data point in support of the unsigned semantics, InstComine already uses zext to canonicalize index type (see getPreferredVectorIndex).  Several of the transforms use unsigned comparison.  So, at IR level, we seem to uniformly be expecting unsigned behavior.

On the RISCV changes, several of these look like regressions, but it comes down to the fact that arguments in the tests are already sign extended, so the sext is cheaper than the zext.  One thing I note - which may be generally useful - is that anything above i32 (i.e. where the zext vs sext difference is observable in these tests) is definitely out of bounds.  Since out of bounds returns poison, I believe we can use an any extend here.  This might reduce the impact.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132978



More information about the llvm-commits mailing list