[llvm-commits] vector widening patch

Mon Ping Wang wangmp at apple.com
Mon Oct 20 10:46:48 PDT 2008


Hi Stefanus,

No numbers to back that choice up.  The thinking was that instead of  
worrying about packing and unpacking a two element vector that it  
might be cheaper to treat it as two scalar computation as a general  
rule.  For x86 with SSE2+, I have no problem saying that we should  
always widen.  With MMX, it is less clear.  Do you think that in  
general, it always make sense to widen?

  -- Mon Ping

On Oct 20, 2008, at 8:18 AM, Stefanus Du Toit wrote:

> Hi Mon Ping,
>
>> +  // If it a vector of two, we will assume it doesn't make sense  
>> to widen
>> +  if (NElts == 2)
>> +    return MVT::Other;
>
> What's the reasoning behind this? In our experience this makes a lot  
> of sense, at least on x86 SSE2+ (assuming MMX is disabled).
>
> Stefanus
>
> On 18-Oct-08, at 12:12 AM, Mon Ping Wang wrote:
>> Hi,
>>
>> Here is a patch for vector widen.  In certain cases, it is more
>> profitable to widen a vector from an illegal type to a legal type
>> (e.g., v7i8 to v8i8) instead of scalarzing the vector.  This patch
>> implements that.  The default implementation is to widen if there  
>> is a
>> legal type that is wider than the illegal type and the vector has  
>> more
>> elements.  Any target can override the default logic and implement it
>> own policy.  Please let me know if you have any comments or concerns.
>>
>> Thanks,
>> -- Mon Ping
>> <widening.patch><ATT00001.txt>
>
> --
> Stefanus Du Toit <stefanus.dutoit at rapidmind.com>
>  RapidMind Inc.
>  phone: +1 519 885 5455 x116 -- fax: +1 519 885 1463
>
>
>




More information about the llvm-commits mailing list