<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVE1vnDAQ_TXmMgJhs3wdOCTZrBopUaW0ao_IgFmcGhthEzb59R3YRNlVEilVV2jlmbHfvHmecWWap4KwbGcm3cDcCQ3iwHuppd7DN65kIwhLLfwW1YW1oq_UE5jJDZMjLCfhloQXx_-ftyS63N6T6AJu8ESDMIOoHbiOO7i9_XUHN_dgWrQFtGbsT8_C8iMspgxItAUrDg4XVzSBA8iMRNdrkIIzb26aoP8UZDaTaoCk11zN_MnCMJpmqsUHzI-cpIWKW1lzhQEOA5fjwo8kIWIfsgBJCN2UysylzA40KS2GkMju3ZZO7rvTPVJbN061k0Zbwq6gwpSLT3BUWAAegWmAWboO8_by4KZRvKZeUALbTW2rxILFcbNBzcZ3qHMn6w61Er0FO1VmcLLnKji7EwOjGAR3eCunfgR--Y4m2yy6YWlKPfY-3fhLLtQFPZXUq78Gv-dj3eH9zNz2EQPwDfjgf4-WiHMjRgi7tHKvfdQFGa5W31CWHQ1ttBv5MGBn-e3gjNQOwAnrSjOUq6Dle83LMEAeH7KOL790OHiWA4mRW9Y5N9hFCrbDb4_6T1VQm_6l8Nf6sXEesHPRbKUSqPUuzfKIhhGuvp7xfDq8poiaPMq5xyfXmbHAbngU2n8wnbZGe9Ooin-mJ62dVn5xxNLM64p4k6dJmyVxSyvapIK3ImliQaM4iWmbN57ilVC2QOkIY1rMsELgGgXy_p-BLFjIWEhpxqJ4E2VBm1csTbKszTmlG8HJJhQ9lypYcAIz7r2xWCGraW8xqKR19i3I7dJOQqyEkaGTTq3Gj5u7LTrOZrvi9Z9ltBojLPZs6uDlIVgnQz6L9V1Brs_L84LNZ-DTQcfKPhvwszn0VgGKtfq_huOvSQ>53278</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [SIMD] WebAssembly backend doesn't always optimize sext/zext into i16x8.extend_low_i8x16_s/i16x8.extend_high_i8x16_s instructions
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          steven-johnson
      </td>
    </tr>
</table>

<pre>
    (Found when examining Halide's WebAssembly output)

TL;DR: I'd expect that LLVM IR of the form

     %12 = sext <16 x i8> %11 to <16 x i16>

would ~always produce WebAssembly output that is basically a pair of `i16x8.extend_low_i8x16_s` / `i16x8.extend_high_i8x16_s` instructions, but instead we end up with a mixture of `i8x16.shuffle` and other instructions, which seems suboptimal.

To repeat:

```
$ ~/llvm-14-install/bin/llc -march=wasm32  -o - -O3 -mattr=+sign-ext,+simd128,+nontrapping-fptoint  test_op_i16x8_extend_low_i8x16_s_0.ll
```
[test_op_i16x8_extend_low_i8x16_s_0.ll.zip](https://github.com/llvm/llvm-project/files/7893103/test_op_i16x8_extend_low_i8x16_s_0.ll.zip)


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVU8FuozAQ_RpzGYHAhEAOHNqm0VZqtdLuavcYGRiCu8ZG2C5pv34H2qqJ2krdCEWeGfvNm-fnyjSPJePFznjdwNShBjyKXmqpD_BNKNkg47mFP1hdWIt9pR7BeDd4x_iGxVsWXzz__7pl6eX2B0sv4IZONAQzYO3AdcLB7e3vO7j5AaalGKE1Y396FuYf41nCgaVbsHh0tLhK1nAEWbD0eikm4MxbOllT_hRkMl41wPJroSbxaGEYTeNr_ID5MydpoRJW1kJRQcAg5DjzY-uYsI9FRCRQN3tlpr0sjsl6b6lERHbvtnTy0J3ukdq60ddOGm0Zv4KKWs45FKQwAh0BP8AkXUd9e3l0fsTX1jNKZDvftgpnLEGbDWk2vkOdOll3pBX2FqyvzOBkL1R0dicGRhxQOLqV0zwBv3zPIV_NutFoSj30YbIK516kC2UqqZd8DWEvxrqj-5mE7VMOEBoIIfyezhXnRqowfmnlQYekCzFcor5JePEcaKPdKIaBnBW2gzNSOwCH1u3NsF8E3b_XfB9HxOND1tnllw5HT3JgGXErOucGO0vBd_QdSH9fRbXpXwZ_nZ-Mc0_OpbCVCknrXV5s0iROafX1juevI2jKtNmkGxE46RSWRP7nzd2WeJ35sxL139kejUFLuucOXsy83K58wuVtEI-n-YmQgAY-NSvffWrSMy8FflTlf0sjrfWLNlnK8yLoyqbdtFjwVZY1eZbHSZOnQsQYt3UsVrzlgRIVKjtPzjjXOMECQWsSIZAljzmPk6TgabZKi6jdVDxfF0W7EUmyQsFWMfZCqmjmEZnxEIzlQqnyB0tFJa2zb0VhZyPiIvSML7zrzFjSG3xAHd6bTlujg4VBuUzwD57XmeI">