[PATCH] Disable load/store vectorization for types with padding bytes

Daisuke Takahashi dtakahashi42 at gmail.com
Wed Apr 24 02:19:03 PDT 2013


Hi Nadav,

>> +    if (0 == Stride || ScalarAllocatedSize != VectorElementSize) {
> I think that it should be:
> 	if (0 == Stride && ScalarAllocatedSize == VectorElementSize) {
In my understanding, the cost model gives up the vectorization when above conditions are met. My patch says there are two different conditions that the optimizer should not vectorize memory instructions,
 1. the target pointer is not an array (I suppose, stride == 0),
 2. the size of array and vector elements are different (the new one).
 Those conditions seems to be independent, and both conditions should be concerned.

> Can you please provide a test case ?   Also, if you attach a file to the email it would make it easier apply the patch. 
I apologize for troubling you, I attach both of them on this email. The test case simply checks if there is not bit-casting from x86_fp80 array to vector, because I could not figure out how can it check the wrong "result" when it runs.

Regards,
Daisuke

-------------- next part --------------
A non-text attachment was scrubbed...
Name: LoopVectorize.cpp.diff
Type: application/octet-stream
Size: 1294 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130424/0774a57f/attachment.obj>
-------------- next part --------------
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-x86_fp80-vector-store.ll
Type: application/octet-stream
Size: 1171 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130424/0774a57f/attachment-0001.obj>
-------------- next part --------------




More information about the llvm-commits mailing list