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

    <tr>
        <th>Summary</th>
        <td>
            Crash when trying to compile SIMD type with VE backend
        </td>
    </tr>

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

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

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

<pre>
    compiling the following code with llc:
```llvm
; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "adler.707c2e002c6e23cc-cgu.0"
target datalayout = "e-m:e-i64:64-n32:64-S128-v64:64:64-v128:64:64-v256:64:64-v512:64:64-v1024:64:64-v2048:64:64-v4096:64:64-v8192:64:64-v16384:64:64"
target triple = "ve-unknown-linux-gnu"

define dso_local void @_ZN5adler4algo5U32X44from17heee8ff6a15a219acE(ptr %_0) unnamed_addr #0 {
start:
  br i1 poison, label %bb7, label %panic3

bb7: ; preds = %start
  store <4 x i32> zeroinitializer, ptr %_0, align 4
  ret void

panic3: ; preds = %start
 unreachable
}

attributes #0 = { "target-features"="+vpu" }

!llvm.ident = !{!0}

!0 = !{!"rustc version 1.73.0-dev"}
```
crashes with 

```
Do not know how to custom type legalize this operation!
UNREACHABLE executed at /home/lena/GitClone/llvm-project/llvm/lib/Target/VE/VEISelLowering.cpp:1963!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
```
<details>
<summary><strong>backtrace</strong></summary>
<p>

```
Stack dump:
0.      Program arguments: ./build/bin/llc /home/lena/test.ll
1.      Running pass 'Function Pass Manager' on module '/home/lena/test.ll'.
2.      Running pass 'VE DAG->DAG Pattern Instruction Selection' on function '@_ZN5adler4algo5U32X44from17heee8ff6a15a219acE'
 #0 0x000055ea921280ce llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/lena/GitClone/llvm-project/llvm/lib/Support/Unix/Signals.inc:602:22
 #1 0x000055ea9212849f PrintStackTraceSignalHandler(void*) /home/lena/GitClone/llvm-project/llvm/lib/Support/Unix/Signals.inc:675:1
 #2 0x000055ea92125b5f llvm::sys::RunSignalHandlers() /home/lena/GitClone/llvm-project/llvm/lib/Support/Signals.cpp:104:20
 #3 0x000055ea92127a33 SignalHandler(int) /home/lena/GitClone/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x00007f6437a4fab0 (/usr/lib/libc.so.6+0x39ab0)
 #5 0x00007f6437a9f26c (/usr/lib/libc.so.6+0x8926c)
 #6 0x00007f6437a4fa08 raise (/usr/lib/libc.so.6+0x39a08)
 #7 0x00007f6437a38538 abort (/usr/lib/libc.so.6+0x22538)
 #8 0x000055ea9206c7aa bindingsErrorHandler(void*, char const*, bool) /home/lena/GitClone/llvm-project/llvm/lib/Support/ErrorHandling.cpp:221:55
 #9 0x000055ea90738f2f llvm::VETargetLowering::ReplaceNodeResults(llvm::SDNode*, llvm::SmallVectorImpl<llvm::SDValue>&, llvm::SelectionDAG&) const /home/lena/GitClone/llvm-project/llvm/lib/Target/VE/VEISelLowering.cpp:1960:5
#10 0x000055ea91f68ab5 llvm::DAGTypeLegalizer::CustomLowerNode(llvm::SDNode*, llvm::EVT, bool) /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:931:27
#11 0x000055ea91f86603 llvm::DAGTypeLegalizer::SplitVectorResult(llvm::SDNode*, unsigned int) /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:972:3
#12 0x000055ea91f653ef llvm::DAGTypeLegalizer::run() /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:283:17
#13 0x000055ea91f69a58 llvm::SelectionDAG::LegalizeTypes() /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:1059:37
#14 0x000055ea91ed11d8 llvm::SelectionDAGISel::CodeGenAndEmitDAG() /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:807:36
#15 0x000055ea91ed06b2 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, bool&) /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:702:1
#16 0x000055ea91ed63b2 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1705:33
#17 0x000055ea91ecf0df llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:483:7
#18 0x000055ea90726e1a (anonymous namespace)::VEDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/lena/GitClone/llvm-project/llvm/lib/Target/VE/VEISelDAGToDAG.cpp:46:3
#19 0x000055ea90f96169 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:91:33
#20 0x000055ea917742d8 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/lena/GitClone/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1435:20
#21 0x000055ea917745aa llvm::FPPassManager::runOnModule(llvm::Module&) /home/lena/GitClone/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1481:13
#22 0x000055ea917749ff (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/lena/GitClone/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1550:20
#23 0x000055ea9176f608 llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/lena/GitClone/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:535:13
#24 0x000055ea917752d1 llvm::legacy::PassManager::run(llvm::Module&) /home/lena/GitClone/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1678:1
#25 0x000055ea9016cb4e compileModule(char**, llvm::LLVMContext&) /home/lena/GitClone/llvm-project/llvm/tools/llc/llc.cpp:754:66
#26 0x000055ea9016a37a main /home/lena/GitClone/llvm-project/llvm/tools/llc/llc.cpp:416:35
#27 0x00007f6437a39850 (/usr/lib/libc.so.6+0x23850)
#28 0x00007f6437a3990a __libc_start_main (/usr/lib/libc.so.6+0x2390a)
#29 0x000055ea90168f25 _start (./build/bin/llc+0x592f25)
[1]    1802379 IOT instruction (core dumped)  ./build/bin/llc ~/test.ll
```

</p>
</details>

this issue was encountered while trying to port rust to the NEC Vector Engine and doesn't occur when using [SX-Aurora TSUBASA Research's llvm fork](https://github.com/sx-aurora-dev/llvm-project).

this requires llvm to be built with the VE backend enabled. (-DLLVM_TARGETS_TO_BUILD="X86;VE")

tested on commit 16a0fc2bb81f1d66ff66f08053e45d8857afd66d. 


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMWVtv27iz_zTMC2GDInV9yIOv2QBpt0jSYHFeDEoa2TylSR-SymUfzmf_g5QcS276z17a7gKBY43FmfnNnSS3VmwVwCVK5ihZXvDW7bS5lKD4E1cgL0pdv1xWen8QUqgtdjvAjZZSP_mnSteAn4TbYSkrxGaILBGZoZR0f1I-7nsSm-MPum4lXC8xYkuMaFa224MWyk0M1G0F9cSK_UGKRkA9LStEs26p1a2pYNMIr9Me-tWU1xLMNCNZRYEQWqVAWVVNqm07JYjSbq3jZgsO19xxyV90646rYbJHbAYTkcaIzdJ4ohjtvtxFNJ889uSO9BjRfPhIk3T4mER09DKho8WUxKPVMSlGy_OoGK9PWT5gcI7FGXGQr1Z4hEmrvij9pCZSqPZ5slXt64rus4ZGKMC11RupKy7xoxY1RjHZ_M_HJFgx5nKrk8-M_hbHjdH7KNsBQN40KY8STqOCVytE84MzGNF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