[llvm-commits] [PATCH] extend fix to PR12312 to support 256-bit vector

Michael Liao michael.liao at intel.com
Wed Sep 5 23:58:41 PDT 2012


Hi

Fix to PR12312 only supports 128-bit vector. This patch extends the
support to 256-bit vector as well. The patch includes 2 major changes:

+ one change to, when bitcasting 256-bit vector (or wider) to 256-bit
integer, allow type legalization to extract elements instead of storing
whole vector followed by loading each element.
  Suppose a N-bit vector into a N-bit integer. Type legalization will
try cast that N-bit vector into <2 x (N/2)> vector first and extract the
lo/hi part. When N = 128, <2 x (N/2>) is legal. But, when N =256, <2 x
i128> is illegal (on x86) and type legalization falls back to store/load
approach.
  When <2 x (N/2)> is found illegal, this patch tries to check <M x
ExtVT>, where ExtVT is the type which N-bit integer is extended onto,
e.g. on x86, 256-bit integer will be extended to 64-bit integers and we
will try <4 x i64>. If <M x ExtVT> is legal, we will extract elements
from it and build N/2-bit lo/hi parts.

+ the other change is X86-specific. This patch moves the previous logic
recognizing OR'd tree into IR lowering phase to reduce DAG combination
overhead. In addition, it's enhanced to handle OR'd tree from elements
extracted from 1+ 128-/256-bit vectors. If more than more than input
vectors are found, it will POR first and finally PTEST. Otherwise, just
a single PTEST.

Test cases are enhanced with 256-bit vectors.

Thanks for review.

Yours
- Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-add-wider-integer-support-for-PR12312.patch
Type: text/x-patch
Size: 16726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120905/e118bbf5/attachment.bin>


More information about the llvm-commits mailing list