[PATCH] D77881: [VectorUtils] add IR-level analysis for widening of shuffle mask

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 08:53:32 PDT 2020


spatel created this revision.
spatel added reviewers: RKSimon, lebedev.ri, efriedma.
Herald added subscribers: hiraditya, mcrosier.

This is similar to the recent move/addition of "scaleShuffleMask" (D76508 <https://reviews.llvm.org/D76508>), but there are a couple of differences:

1. The existing x86 helper (canWidenShuffleElements) always tries to divide-by-2, so it gets called iteratively and wouldn't handle the general case of non-pow-2 length.
2. The existing x86 code handles "SM_SentinelZero", but we don't have that in IR.

The motivation is to enable shuffle folds in instcombine/vector-combine that are similar to D76844 <https://reviews.llvm.org/D76844> and D76727 <https://reviews.llvm.org/D76727>, but in the reverse-bitcast direction. Those patterns are visible in the tests for D40633 <https://reviews.llvm.org/D40633>.


https://reviews.llvm.org/D77881

Files:
  llvm/include/llvm/Analysis/VectorUtils.h
  llvm/lib/Analysis/VectorUtils.cpp
  llvm/unittests/Analysis/VectorUtilsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77881.256579.patch
Type: text/x-patch
Size: 5364 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200410/3f0b28da/attachment.bin>


More information about the llvm-commits mailing list