<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/134360>134360</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LoopIdiomRecognize incorrectly disables memcpy formation from stores of non-integral pointers
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            resistor
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          resistor
      </td>
    </tr>
</table>

<pre>
    The comment on this line https://github.com/llvm/llvm-project/blob/5812516ae2e034d70b0cca20b95d627e163b4567/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp#L442 indicates that the condition is intended to prevent the formation of `memset`/`memset_pattern` from loops storing non-integral pointers. 

In reality, by returning `LegalStoreKind::None`, it is also implicitly disabling `memcpy` formation from such loops, which is not intended to be disallowed.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUU01v5CoQ_DX4gjLCGNszBx_m5clS9KJ32OS-4qPH7hWmLcCJZn_9Cmey2VX2sicb6C6qqgudEk4BYGDtP0zKCAlTpsikZO2_ld7yTHF4360MuevwPAO3tCwQMqfA84yJewzA55zXxJozkyOT44R53szB0sLk6P3L--dujfQNbGZyNJ4Mk2N7rGVbdxokiEa5XhhhrZbCnFrXyR7qrjGq7fpfcLD0PUcd0oXikpgcn6z2OjI5PhKtDw5p-QKWpoDf4WDXlcnmUSnJMTi0OkPiedaZ511LcJiRAsfEMWQIDhzPxNcIL0VkKSrX6L2ILpx1YoElQWadKGLfl19XnTPEwDrBL5EW7onWxIt1GCYeKNwV_Clqz1cqvzEdOBNnJs4PgUfQHvOVyXturjxC3mIofawTjzBp_5Qpwn8YXPG4Of9PAXYC9xxz4a59Io7L6tFi9lfuMGnjbwgLLHa97sx-Stk5ps3Ob0QL0uuMdi5ggfJvZhjY8bynV3CHyg2NOzUnXcFQ96rpu7oRqpoH21ujnBTSgG1OSvdwhEvTGwF1f-lPfYWDFLIVSqhaiKNUB7CmVp2TtpOtO3YtUwIWjf5QZn2gOFWY0gZD3aimE5XXBny6xTXAK99Pb3mNw54ws02JKeEx5fQBkzF7GD7Hg2OwFCPYD88g8Te_PplVRpBKBv44zGqLfvjrZ7ArKBm-SXwZ5I8AAAD__5Y1NW0">