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

Shemer, Anat anat.shemer at intel.com
Sun Mar 11 09:32:05 PDT 2012


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120311/137570d7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: X86StoreCombin.patch
Type: application/octet-stream
Size: 1043 bytes
Desc: X86StoreCombin.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120311/137570d7/attachment.obj>


More information about the llvm-commits mailing list