[PATCH] D81766: [VectorCombine] try to create vector loads from bitcasted scalar pointers

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 14:49:51 PDT 2020


spatel created this revision.
spatel added reviewers: lebedev.ri, RKSimon, anton-afanasyev, vporpo, ABataev.
Herald added subscribers: steven.zhang, hiraditya, mcrosier.
Herald added a project: LLVM.

This is D64142 <https://reviews.llvm.org/D64142> moved from SLP to VectorCombine. That patch stalled because it didn't fit neatly into the SLP mold, but this matches the template we've used for other VectorCombine transforms.

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.

That should allow this pass or others 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/D81766

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81766.270516.patch
Type: text/x-patch
Size: 9091 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200612/ab6c6e60/attachment-0001.bin>


More information about the llvm-commits mailing list