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

    <tr>
        <th>Summary</th>
        <td>
            Bug in SLP Vectorizer
        </td>
    </tr>

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

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

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

<pre>
    The following code snippet can be a source of crashes:
 https://github.com/llvm/llvm-project/blob/4a890c2c605640f48ecbaefebda8f3a42043ff3d/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp#L5016-L5019

when `getPointersDiff` returns `std::nullopt`.  I see this problem recurring in a few other places in the file as well.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUkk1r3DAQhn-NfBliZFn22gcdEoKhsJSFhN5H8shW0VpGkrO0v77ItE2vvehr0Hw874spuWUjUqx7Yd1rhUdeQ1RfXVwxVjrMP9T7SmCD9-HhtgVMmAnS5vadMhjcQBMgpHBEQxAsmIhppcTaZ8afYc15P89iYmJaXF4PXZtwZ2Ly_uPP9rTH8J1MZmLSPmgmJonDyI0wPe96ya0cyGgkS3rGwbYoBZette38Tx5X_r1H3JIN8Z6YmL6RySG6n8TE9Ha9_b3G2uw7E-21403_VNaR8dLuY6UNWM8XyrfgtkwxvTprWc8hUj7ilko05blM1D5vh_dhz6znNcAXSESQV5dgj0F7ukMkc8RYoLkNECw9IOSVIuweDaXymgtb5wkwwYO8r6tZtfPYjliRai5tN7Ri6Hm1qp7PSFLyUdt-FtTgjFyO3cWM2KDudeWU4KLjDRdNJy-S12OnL3ruDGmSo-4bJjnd0fm6EKtDXCqX0kGqEY0cxsqjJp9OHwix0QPOKBOi2CKqUyd9LIlJ7l3K6TNNdtmTejnOOd-uN_gkXR3Rq_82wVm5KPi7tQ8lfgUAAP__9qDcAA">