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

    <tr>
        <th>Summary</th>
        <td>
            Miscompile after D155071
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:RISC-V
      </td>
    </tr>

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

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

<pre>
    I have a tail undefined unmasked vrgather.vi with VL=2 followed by a tail undefined vmerge with VL=4. This gets combined to a tail agnostic masked undisturbed masked vrgather.vi with VL =2. I think this needs to be a tail undisturbed VL to account for elements 2 and 3 from the vmerge becoming part of the tail?

I don't have a reduced test case

cc: @preames 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0kkGPmz4QxT-NuYwWGYMhHDjk_48iRdpe2mrvxh7AjbGRPc5qv31Fmm0jVb0MB977zXvWqJTs7BEHJv9jQrh8xV52TAgmT4XKtIQ4UNg2jLoYg_kYLrCoG4ICUtZB9gYn69FA9qtKVzRwi7OiBWN5s_BuaYG3V1afBEzBufCOBsaPv923FeOMT_qmhO-LTTAjJdBhHe8yCp9WNfuQyGp4bM3e2EQ5jmjg30FgT1LCBWix_rrPBB7RpJ08Prf6DXt7vW_VOmRPMIUI6HBFTwkEKG-ghimGFWjBzxYj6rBaP8OmIkGY7v92MKvPjJ8YP_6aFzDBM9HR55NGNFnvNTERaJXwWa01q4_AGr5FVCsmKMxQm77uVYFD1fZC1IeD7IplaHXbcN1xfRj7Qz91lewnUemubXnVCImFHQQXNT9UHReCy67shZkOFdeSo6xaLVjDcVXWlc7d1jLEubApZRzappNN4dSILj0uZlT6it6w-vj18u3_l7fH6cRht76MeU6s4c4mSn9gZMnh8MUmHdbNOgQ1EUY4VVLyripydMNCtCVWH5k4M3GeLS15LHVYmTjvmMfnZYvhB2pi4nwPmJg43zP-DAAA__9E-ezy">