[PATCH] D79925: [SystemZ] Eliminate the need to create a zero vector by reusing the mask.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 18 11:54:33 PDT 2020


jonpa updated this revision to Diff 264691.
jonpa added a comment.

> Note that fixing the handling of an UNDEF second input can (and probably should) be done as a separate patch, before this optimization is merged.

Committed as 31ecef7 <https://reviews.llvm.org/rG31ecef76275158c87d63772a70fbc282d025e7ab>.

> If we do that, it follows that a completely undefined input should *not* be treated as a zero vector for this optimization. (However, a not fully undefined vector that is a mixture of zero elements and undefined elements can be treated as zero vector. Not sure if this makes much of a difference in practice.)

Removed the check for the undef vector. It also turns out that ISD::isBuildVectorAllZeros() is already accepting some undef elements, as long as they are not all undef, which is exactly what we want.

Patch rebased. The second case (reusing the index into the first byte of the non-zero vector), is eliminating now 13 VGBM.s on SPEC'17, but is not needed for the zero extend inreg patch...

Tests merged into vec-perm-14.ll, which was just committed...


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

https://reviews.llvm.org/D79925

Files:
  llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
  llvm/test/CodeGen/SystemZ/vec-perm-14.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79925.264691.patch
Type: text/x-patch
Size: 6207 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200518/8967d71e/attachment-0001.bin>


More information about the llvm-commits mailing list