[llvm-commits] Patch: updated widen in LegalizeType

Mon Ping Wang monping at apple.com
Sun Nov 30 20:12:32 PST 2008


Hi,

Here is an updated patch based with fixes thanks to comments from  
Duncan.  This patch is long so I didn't include the dozen or so of new  
test cases for X86 to try different aspect of widening. The main  
differences with this version from the previous one are

   1) We have added a few vector simple types (v2i8, v4i8, v2i16)  in  
order to enable getTypeAction to work properly with widening.  Given a  
type, it is clear which ones we want to widen or which ones we want to  
split.

   2) The LegalizeType code no longer uses getWidenVectorTypes.   
Instead, we use getTypeToTransformTo.

   3) The code for converts has changed.  Because the result type and  
the input type different, it is possible we have a legal widen result  
type but if we widen the input type, we might create an illegal vector  
type that might need to be split.  If did widen the input, we might  
end up in a case where we repeatedly try to widen the input, split it,  
and then widen it again.  To avoid this, the code checks if the input  
type is illegal and if so, it will not widen the input.  Instead, it  
does is conservative and unroll the convert and rebuild the vector.

4) Widening of load and stores now support extended vector loads and  
truncating stores.  The current implementation is conservative as it  
unrolls the operation and rebuilds the vector. We could probably do a  
little better here though.

5) Added WidenVecOp_CONCAT_VECTORS as we can have a legal result type  
but the input vectors may not be legal.

In a separate patch, I will send out some fixes that widening exposes  
in codegen for MMX.

Thanks,
-- Mon Ping

-------------- next part --------------
A non-text attachment was scrubbed...
Name: widen2.patch
Type: application/octet-stream
Size: 65141 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081130/c9b807ed/attachment.obj>


More information about the llvm-commits mailing list