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

    <tr>
        <th>Summary</th>
        <td>
            [RISCV] "Don't know how to widen the operands for INSERT_SUBVECTOR"
        </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>
    The enclosed .ll file crashes when run through top-of-tree `llc`; here is the Issue and stacktrace, as requested by the crash message:

```
$ ~/llvm-17-install/bin/llc /tmp/insert_subvector.ll -o /tmp/foof
LLVM ERROR: Don't know how to widen the operands for INSERT_SUBVECTOR
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /usr/local/google/home/srj/llvm-17-install/bin/llc /tmp/insert_subvector.ll -o /tmp/foof
1.      Running pass 'Function Pass Manager' on module '/tmp/insert_subvector.ll'.
2.      Running pass 'RISC-V DAG->DAG Pattern Instruction Selection' on function '@_Z16insert_subvectorP15halide_buffer_tS0_bS0_'
 #0 0x0000563174316e3b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x2a8fe3b)
 #1 0x00005631743147cb llvm::sys::RunSignalHandlers() (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x2a8d7cb)
 #2 0x00005631743148f5 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007fb9a297bf90 (/lib/x86_64-linux-gnu/libc.so.6+0x3bf90)
 #4 0x00007fb9a29caccc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007fb9a297bef2 raise ./signal/../sysdeps/posix/raise.c:27:6
 #6 0x00007fb9a2966472 abort ./stdlib/abort.c:81:7
 #7 0x0000563171f31b91 (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x6aab91)
 #8 0x0000563174274eea (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x29edeea)
 #9 0x00005631741b581c llvm::DAGTypeLegalizer::WidenVecOp_INSERT_SUBVECTOR(llvm::SDNode*) (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x292e81c)
#10 0x00005631741cb1bc llvm::DAGTypeLegalizer::WidenVectorOperand(llvm::SDNode*, unsigned int) (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x29441bc)
#11 0x0000563174176221 llvm::DAGTypeLegalizer::run() (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x28ef221)
#12 0x00005631741773b8 llvm::SelectionDAG::LegalizeTypes() (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x28f03b8)
#13 0x00005631740ea7b0 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x28637b0)
#14 0x00005631740ee980 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x2867980)
#15 0x00005631740f0377 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0) SelectionDAGISel.cpp:0:0
#16 0x00005631735ab7bf llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#17 0x0000563173b46cc9 llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x22bfcc9)
#18 0x0000563173b46e01 llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x22bfe01)
#19 0x0000563173b47717 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x22c0717)
#20 0x0000563171fdfffc compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#21 0x0000563171f36997 main (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x6af997)
#22 0x00007fb9a296718a __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#23 0x00007fb9a2967245 call_init ./csu/../csu/libc-start.c:128:20
#24 0x00007fb9a2967245 __libc_start_main ./csu/../csu/libc-start.c:368:5
#25 0x0000563171fd6851 _start (/usr/local/google/home/srj/llvm-17-install/bin/llc+0x74f851)
Aborted
```
[insert_subvector.ll.zip](https://github.com/llvm/llvm-project/files/11824480/insert_subvector.ll.zip)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8mF1v2zjWxz8NfUPYoEi9XvjCieM-AdppEOfJAnsjUNSRpZYmtSTVJHOxn31B2o4t153O7LgL5MWmpP_5_Q_fjsit7TYKYI6SG5QsJ3xwrTZz6-AbqOkX3Sqr1aTS9dv8qQUMSkhtocYzKXHTScDCcNuCxS8tKGwGhV1r9LBpsdP9VDdTZwAwSomUAqUEsRvcggHcWexawPfWDoC5qrF1XHx1hgtA9BZziw38awDroMbVW7g3RMJbsJZvALEFIktEDn9Tsv_ZfaUx_jeiKym_badRNu2UdVxKRFdVp0K7wIiu3LZHdNUpC8aVdqi-gXDaeGtTfbzeaN3sZD9-fP6E7x4fPz8itsBLrRDNHP6q9Atu9Qt2Gr90NahAq3swXNUWN9rg-9_Wd49P5fr_b57vbp8-P-7kHj7eLdZ32A7VtnOY42rYYAO9Ns5Ltc711tukK0RXm861QzUTeru3dXDXG_0FhPM-fC4toquQz04JOdRwkrnqkODZLvzaZxzXw7Z_TyaZIVI8GL0xfIu52QxbUM5D-GwM1vigWnCfyI3WGwmIrlq99f-s-XL9hEee53FQqlMb3HNrMaLZalDCdVrhB9_wiSu-AYNohrXCW10PEvxdfxQN0WyfA3opwOP9-nb6jJeLD1PE7paLD_iBOwdG4XtlnRl20dcgIXzah24OWD54TMp_Rul56IcoabnsaiiroWnAlG5NympNSv9I4MGIMoLJKyGEJCmLsphFKbAKhy5nC8QW9s3uPjyYTrnQiU-7aZMfbzL8pdTWGeBbRFM_ozrlEC0wovnf70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