[PATCH] D57140: [WIP] Teach instcombine how to destroy vector GEPs

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 25 10:09:39 PST 2019


reames added a comment.

Decided to start from the demanded elements and work my way up to actual transforms.  First two reviews are posted:

- D57177 <https://reviews.llvm.org/D57177> Demanded elements support for vector GEPs
- D57247 <https://reviews.llvm.org/D57247> Simply operands of masked stores and scatters based on demanded elements

Next up is to do the demanded bits for scatter and masked.load.  After that, I should probably do expandload and compressedstore for completeness, though that may be done later since I've never seen their use.

Once that part is in, I'll return to the transforms for the individual instructions.  Mostly as a reminder to self, the patterns of interest for each memory instruction are: splat of each operand, single element active, incrementing addresses, and inferring inactive lanes from undef.  For GEPs, the main ones are scalarizing operands, scalarizing the instruction as a whole, and undef/demanded elt intersection.

The more general building blocks needed for the above discovered so far are:

- Improved splat detection
- Scalar masked store creation utilities
- Horizontal op folding (e.g. or reduce over a mask vector)
- Mask analysis utilities

Just to set expectations appropriately, I'm not promising to see all of the above through.  I intend of making improvements until I stop seeing practical test cases which look painful, and that's about it.  Anyone who wants to pick of a piece is very welcome to.  :)


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

https://reviews.llvm.org/D57140





More information about the llvm-commits mailing list