[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 14:32:32 PDT 2020


spatel updated this revision to Diff 256664.
spatel marked an inline comment as done.
spatel added a comment.

Patch updated:

1. Improved code comments/asserts.
2. Changed logic - allow matching any negative (sentinel) value as long as that value repeats across all elements of a subsection. In the earlier version, we could match partial undef pieces in a widened element, but that means the round-trip with scaleShuffleMask is not always 1-to-1 (partial undefs would get remapped to defined values). This could get us into trouble with poison propagation, so let's avoid that. This way also allows usage from codegen because we would seamlessly handle SentinelZero or any other special mask constants.
3. Added round-trip unit tests to confirm that this is the opposite of scaleShuffleMask. I haven't tried creating exhaustive unit tests before, so not sure yet how to be both exhaustive and not blow up test timing on something like this where we would want to test across multiple dimensions (mask sizes, values, scale factor).


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

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.256664.patch
Type: text/x-patch
Size: 6800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200410/802c7339/attachment-0001.bin>


More information about the llvm-commits mailing list