[PATCH] D64142: [SLP] try to create vector loads from bitcasted scalar pointers

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 10:16:33 PDT 2019


spatel created this revision.
spatel added reviewers: vporpo, ABataev, RKSimon.
Herald added subscribers: jfb, hiraditya, mcrosier.
Herald added a project: LLVM.

This doesn't help the motivating cases in:
https://bugs.llvm.org/show_bug.cgi?id=16739
...yet, but I'd like to get feedback on the general approach.

The general idea is that if we have a legal vector pointer type, but we are bitcasting that pointer to only load a subset of a vector, then load the whole vector (if that is safe) and extract the subset of the vector.

This will allow SLP and/or instcombine to fold subsequent scalar ops together more easily because they will see extractelement ops from a single vector rather than incomplete parts of that vector.

Currently, this transform will make no overall difference to these most basic patterns because the backend (DAGCombiner) will narrow the loads back down to scalars via narrowExtractedVectorLoad().


https://reviews.llvm.org/D64142

Files:
  llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Transforms/SLPVectorizer/X86/load-bitcast-vec.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64142.207823.patch
Type: text/x-patch
Size: 9671 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190703/cd039499/attachment.bin>


More information about the llvm-commits mailing list