[llvm-commits] [PATCH] in PerformSTORECombine check befor generating node

Bill Wendling wendling at apple.com
Mon Mar 12 01:12:36 PDT 2012


Oh! nice catch. Looks good to me.

-bw

On Mar 11, 2012, at 9:32 AM, Shemer, Anat wrote:

> Hi,
>  
> I will appreciate if you can review the following patch (I can do the commit).
>  
> In X86ISelLowering.cpp in the function PerformSTORECombine() there is the CODE BELOW.
> The code first generates a type WideVecVT, then creates a node for this type and only after that checks if WideVecVT is a legal type.
> I switched the code so the check is done before the redundant node is created.
>  
>     // Create a type on which we perform the shuffle
>     EVT WideVecVT = EVT::getVectorVT(*DAG.getContext(),
>             StVT.getScalarType(), NumElems*SizeRatio);
>  
>     assert(WideVecVT.getSizeInBits() == VT.getSizeInBits());
>  
>     SDValue WideVec = DAG.getNode(ISD::BITCAST, dl, WideVecVT, St->getValue());
>     SmallVector<int, 8> ShuffleVec(NumElems * SizeRatio, -1);
>     for (unsigned i = 0; i < NumElems; i++ ) ShuffleVec[i] = i * SizeRatio;
>  
>     // Can't shuffle using an illegal type
>     if (!TLI.isTypeLegal(WideVecVT)) return SDValue();
>  
> Regards, Anat
>  
>  
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
> 
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies. <X86StoreCombin.patch>_______________________________________________
> 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