[llvm-commits] Patch: small fix to bit convert and shifts

Mon Ping Wang monping at apple.com
Wed Dec 3 11:38:36 PST 2008


Hi,
On Dec 1, 2008, at 10:44 AM, Evan Cheng wrote:

>
> On Nov 30, 2008, at 8:32 PM, Mon Ping Wang wrote:
>
>> Hi,
>>
>> This is a small patch that fixes two problems in SelectionDAG.cpp
>>
>> 1) in getShuffleScalarElt, the code assumes that if the input to
>> the shuffle is a BIT_CONVERT, the input to the bit convert is also a
>> vector.  This is not necessarily true as it is legal to bit convert a
>
> You didn't finish your sentence? :-)
>

My mind was going one way and my finger went another :->.  What I mean  
to say it is legal to bit convert a scalar type to a vector type so  
the assumption that the input to the bit convert  must be a vector  
type is incorrect.  The current code assumes that it is vector and  
asks for number of vector elements.  The change is to make sure that  
the incoming type is a vector first before asking for the number of  
vector elements.

>>
>>
>> 2) In getNode, the code assumes that for shifts, the shift amount
>> is always a scalar.  Since shifts can operate also on vectors, this
>> assumption is not correct.
>
> The shift amount can be a vector as well? I thought operand 1 can be,
> but not the shift amount.
>

I thought so though I am probably reading the lang ref liberally.

-- Mon Ping


> Evan
>
>>
>>
>> -- Mon Ping
>>
>> <selection.patch>_______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list