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

    <tr>
        <th>Summary</th>
        <td>
            [AArch64][SVE] many redundant Unsigned unpack instructions compare to gcc
        </td>
    </tr>

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

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

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

<pre>
    test: https://godbolt.org/z/TzEPaEhjz
```
void mc_chroma(uint8_t *__restrict dst, int i_dst_stride,
               uint8_t *__restrict src, int i_src_stride,
               int mvx, int mvy,
               int i_width, int i_height)
{
    uint8_t *srcp;

    int d8x = mvx&0x07;
    int d8y = mvy&0x07;
    int cA = (8-d8x)*(8-d8y);
 int cB = d8x    *(8-d8y);
    int cC = (8-d8x)*d8y;
    int cD = d8x *d8y;

    src += (mvy >> 3) * i_src_stride + (mvx >> 3);
    srcp = &src[i_src_stride];
    
    for( int y = 0; y < i_height; y++ )
 {     
        for( int x = 0; x < i_width; x++ )
            dst[x] = ( cA*src[x]  + cB*src[x+1] + cC*srcp[x] + cD*srcp[x+1] + 32 ) >> 6;
 dst  += i_dst_stride;
        src   = srcp;
        srcp += i_src_stride;
    }        
}
```
* **clang**:  many redundant Unsigned unpack instructions in the kernel loop body
```
.LBB0_7: // Parent Loop BB0_4 Depth=1
  // => This Inner Loop Header: Depth=2
  add x19, x3, x6
  mov z6.d, z4.d
  mov z7.d, z5.d
  ld1b { z4.b }, p0/z, [x19, x1]
  add x19, x2, x6
  ld1b { z5.b }, p0/z, [x19, x1]
 splice z6.b, p3, z6.b, z4.b
  uunpklo z16.h, z4.b
  uunpkhi z17.h, z4.b
  splice z7.b, p3, z7.b, z5.b
  uunpkhi z18.h, z5.b
  uunpklo z19.h, z5.b
  uunpkhi z20.h, z6.b
  uunpklo z6.h, z6.b
  mul z16.h, z3.h, z16.h
  uunpklo z21.h, z7.b
  uunpkhi z7.h, z7.b
  mul z18.h, z3.h, z18.h
  mul z17.h, z3.h, z17.h
  mul z19.h, z3.h, z19.h
  mad z6.h, p1/m, z2.h, z16.h
  movprfx z16, z17
  mla z16.h, p1/m, z2.h, z20.h
  movprfx z17, z19
  mla z17.h, p1/m, z2.h, z21.h
  mad z7.h, p1/m, z2.h, z18.h
  mul z16.h, z16.h, z1.h
  mul z6.h, z6.h, z1.h
 mad z7.h, p1/m, z0.h, z16.h
  mla z6.h, p1/m, z17.h, z0.h
  rshrnb z7.b, z7.h, #6
  rshrnb z6.b, z6.h, #6
  uzp1 z6.b, z6.b, z7.b
 st1b { z6.b }, p0, [x0, x6]
  add x6, x6, x16
  cmp x5, x6
  b.ne .LBB0_7
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVkmv4jgQ_jXmYj2U2FkPHAh5aEbqQ0vTM1eUxIakXzbZDh349aNyHLIAs6CnR1L11VerCydSFpea8x1yI-TGm6RTeSN21zM7nzdpw247xaVCdI9zpVqJ6B6RIyLHS8PSplTbRlwQOd4ROf64f35PPvOfd2TFyNojzzJ_-vXaFAxX2SnLRVMliARdUavgpDAi-9NJcKlEkSnMpELkgIta4eLEpDqBnHFEDgMNXn5ek0iRTSRSZP9CArjq2o8m1fX2T8ji9KtgKp8c5Ly45AqR0OTtR5PtLD4pshZRo5sQwMGCHiMaD0F4Vm_5D-AEuRnI7R0k22sEIkHwwYIeAiJ783aDt4eBRkcaDa4xxu-QI_XhBTVgn4Dxg3WFmHBSZBiRyBBWV0jsE9FPTBEJwWzRNIAOuH6OW3iG0poAPei9Gy3a7sYL9PR0bgQigQ58qK6FaKQfD1NfQQLh6jBMjzHyI7zkWvH1E19v-IaxAcET3ewDB8CNeuTGY8lxth_GZ5TrkmTRTEgiWxuA_DDO2sgCwngunKEpwbroQ2G9qU5MKjx2aXEQ55Ucu4l1qIsBn6nbiWfWlEVH_HjEj2cofrlEYDj0qO6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