[PATCH] Optimise chains when splitting vector loads & stores

Richard Sandiford rsandifo at linux.vnet.ibm.com
Fri Jun 28 03:14:41 PDT 2013


When vector loads and stores are split into two, the original chain
is replaced with a TokenFactor of the two new loads or stores.
This means that if the chain for a vector store (say) is a load
from the same address X, we end up with:

  load from Xlo  load from Xhi
         \           /
          TokenFactor
         /           \
  store to Xlo    store to Xhi
         \           /
          TokenFactor

In cases like these we can just use:

  load from Xlo  load from Xhi
         |            |
  store to Xlo    store to Xhi
         \           /
          TokenFactor

This optimisation overlaps with -combiner-alias-analysis, but it seems
like a simple and obvious case that is hopefully less controversial than
turning -c-a-a on by default.  (But it's because of -c-a-a that isAccessTo()
is so restricted.  It isn't trying to be a general alias check.)

The motivation for doing this is that natural conditional vector stores
become natural conditional scalar stores, which helps improve the llvmpipe
code for SystemZ.

Thanks,
Richard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvt-chains.patch
Type: text/x-patch
Size: 12311 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130628/2102def6/attachment.bin>


More information about the llvm-commits mailing list