[PATCH] D78486: [SystemZ] Expand vector zero-extend into a shuffle.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 05:22:20 PDT 2020


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

Patch rebased.

I updated the tests and noticed that not all VGBMs where going away. In order to achieve that I added look-through of BITCAST in isZeroVector(). This changed a few files on SPEC'17:

In total 11 less VGBMs on SPEC, over 10 files, but also some unexpected changes:

- morphology.s: One *more* vgbm than before. Regalloc seems to now spill the big VGBM interval now and as a result the VGBM is rematerialized in two places which makes for actually one more VGBM with this. Here the VGBM was used also by a VFMAXDB. The VGBM was available over many blocks.

- fx.s: four more new and different VPERM masks (LCPI constants) in the text section. This seems to be because four masks where reused before, while now they are not. This is because only one of of the users of that mask had a zero vector operand. With the zero vector this mask is used:

cp#8: <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 16, i8 17, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 18, i8 19>

Without the zero vector, this mask instead:
cp#2: <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 16, i8 17, i8 0, i8 0, i8 0, i8 0, i8  0, i8  0, i8 18, i8 19>

This file also has a few more spills/reloads for some reason, probably because of the increased presence of mask registers. These side-effects are just noticed in this particular file...

It may be possible to treat this as a global problem where the goal is to minimize the number of LCPI vector constants needed, considering that removing the use of the zero vector can instead cause a new mask to be needed where as before an already existing mask could be reused. Not sure how needed or easy that would be...

In addition to this, some NFC changes:

- Removed the check for the undef vector also in this patch.
- Minor fixes such as variable renaming.
- Tests no longer need VGBMs :-)



                                 master      <>        patch
  vuplhh         :                 3323                  241    -3082
  vuplhb         :                 3137                  220    -2917
  vperm          :                20996                23777    +2781
  vpkg           :                 1535                  750     -785
  vl             :               109474               109943     +469
  vuplhf         :                  778                  329     -449
  vmrlg          :                 4481                 4088     -393
  vsldb          :                  566                  191     -375
  larl           :               371292               371627     +335
  cghsi          :                34550                34393     -157
  lg             :              1092297              1092153     -144
  
  ...
  
                                 master      <>        patch
  Spill|Reload   :               683254               683105     -149
  Copies         :              1036372              1036441      +69
  grep "LCPI.*:" :                17540                17741     +203


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

https://reviews.llvm.org/D78486

Files:
  llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
  llvm/lib/Target/SystemZ/SystemZISelLowering.h
  llvm/test/CodeGen/SystemZ/vec-move-16.ll
  llvm/test/CodeGen/SystemZ/vec-move-23.ll
  llvm/test/CodeGen/SystemZ/vec-move-24.ll
  llvm/test/CodeGen/SystemZ/vec-zext.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78486.264860.patch
Type: text/x-patch
Size: 17541 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200519/e30607e3/attachment.bin>


More information about the llvm-commits mailing list