[PATCH] D107580: [VectorCombine] Support AND/UREM indices that require freezing.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 16 06:18:46 PDT 2021


fhahn updated this revision to Diff 366610.
fhahn added a comment.

Added assertion as suggested and also just update operands of UserI, thanks!

In D107580#2944538 <https://reviews.llvm.org/D107580#2944538>, @nikic wrote:

> Is these some specific use case for handling this special case?

LLVM doesn't do a great job when lowering operations on largish vectors in general, e.g. originating from uses of extended vectors in C/C++ or other frontends. The patch in particular improves the lowering of code like below

  using vec_ty = float __attribute__((ext_vector_type(32)));
  
  void foo(vec_ty *ptr, int idx) {
    (*ptr)[idx&31] = 0.0;
  }

https://godbolt.org/z/cq97c4KG5


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107580

Files:
  llvm/lib/Transforms/Vectorize/VectorCombine.cpp
  llvm/test/Transforms/VectorCombine/load-insert-store.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107580.366610.patch
Type: text/x-patch
Size: 7688 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210816/cac24f78/attachment.bin>


More information about the llvm-commits mailing list