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

    <tr>
        <th>Summary</th>
        <td>
            [LV][EVL] Support interleaved accesses for EVL tail folding.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            vectorizers
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            Mel-Chen
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Mel-Chen
      </td>
    </tr>
</table>

<pre>
    The motivation for this issue is to provide better support for RVV unit-strided segment load/store. 
The following scenarios need to be supported: 
* Interleaved load (vp.load + interleave)
* Interleaved load with tail gaps (Requires scalar epilogue to run the last iteration)
* Fully interleaved store (deinterleave + vp.store)
* Interleaved store with gaps (This can not emit unit-strided segment store. We can only emit a wide masked store for that)

Due to the high complexity of `VPInterleaveRecipe::execute()`, creating a new recipe or converting it into `VPWidenIntrinsicRecipe` does not seem like a wise approach.
A tentative approach I have in mind is to first split `VPInterleaveRecipe` into `VPWidenLoad + VPDeinterleave` and `VPInterleave + VPWidenStore`. During the EVL lowering phase, we would only need to transform `VPWidenLoad/VPWidenStore` into `VPWidenLoadEVL/VPWidenStoreEVL`.
For now, the focus will be on supporting factor 2 (`interleave2/deinterleave2`) as the initial target, with support for factors 3 to 8 planned after  test results are stable.
Related IAP support: #120490 .
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0VNFu2zoM_Rrlhaghy4mTPPghXRagQC9QdEP2LNuMrTtZ8hXpZL1fP0hxlqLonhLQ5OE5hxQ1kekcYiVWj0Kpf9A-fOnRCaXEar_QE_c-VLfoovbtW_W9Rxg8m7Nm4x2cfADuDYEhmhAMAXsYgz-bFqFGZgxA0zj6wCn39XiEyRl-IA6mxRYIuwEdg_W6FepA7ANmIOQuNjp5a_3FuA6oQaeD8QQOsY1NarwBYyuKXSwRagdPjjFY1GdsEyYItTmP2fz3Ecyf70Jt_1Zz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