<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65716>65716</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[x86_64] AES Intrinsics Cause Backend Crash
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
HazyFish
</td>
</tr>
</table>
<pre>
## Desciption
The following code containing AES Intrinsics crashed with error `LLVM ERROR: Do not know how to split the result of this operator!` when targeting `x86_64` with `aes` feature on.
## Minimal Reproduction
https://godbolt.org/z/W4fMrK5WP
### Code
```ll
define void @f(ptr %0) {
BB:
%C = call <8 x i64> @llvm.x86.aesni.aesdec.512(<8 x i64> <i64 7, i64 7, i64 7, i64 7, i64 7, i64 7, i64 7, i64 7>, <8 x i64> <i64 7, i64 7, i64 7, i64 7, i64 7, i64 7, i64 7, i64 7>)
store <8 x i64> %C, ptr %0, align 64
ret void
}
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare <8 x i64> @llvm.x86.aesni.aesdec.512(<8 x i64>, <8 x i64>) #0
attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) }
```
### Stack Trace
```console
SplitVectorResult #0: t6: v8i64 = llvm.x86.aesni.aesdec.512 TargetConstant:i64<11978>, t5, t5
LLVM ERROR: Do not know how to split the result of this operator!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mtriple=x86_64 -mattr=aes <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'X86 DAG->DAG Instruction Selection' on function '@f'
#0 0x00000000033ad8f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x33ad8f8)
#1 0x00000000033ab02c SignalHandler(int) Signals.cpp:0:0
#2 0x00007f17ccaab420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#3 0x00007f17cc56e00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#4 0x00007f17cc54d859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#5 0x0000000000697aeb (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x697aeb)
#6 0x0000000003301768 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3301768)
#7 0x0000000003259e4c llvm::DAGTypeLegalizer::SplitVectorResult(llvm::SDNode*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3259e4c)
#8 0x0000000003207ce3 llvm::DAGTypeLegalizer::run() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3207ce3)
#9 0x0000000003208b29 llvm::SelectionDAG::LegalizeTypes() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3208b29)
#10 0x0000000003181230 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3181230)
#11 0x0000000003184bf8 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3184bf8)
#12 0x00000000031868f2 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0) SelectionDAGISel.cpp:0:0
#13 0x0000000001ba654c (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) X86ISelDAGToDAG.cpp:0:0
#14 0x0000000002697f39 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#15 0x0000000002c11b79 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2c11b79)
#16 0x0000000002c11db1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2c11db1)
#17 0x0000000002c125d2 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2c125d2)
#18 0x000000000075d782 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#19 0x000000000069d176 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x69d176)
#20 0x00007f17cc54f083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#21 0x000000000075413e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x75413e)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0mN9z4ygSx_8a8tJllwT6-eAH_4izUze5TcVTs_OWQgjbXBCoAE2c-euvQHJiOb7b2R1vKlFkkL_96aZpQNRasVOcz1C6QOnqhnZur83sN_rjdS3s_qbS9esMYYIwgRW3TLROaIWiFYrm_fXLnsNWS6lfhNoB0zUHppWjQvnP89sNfFLOCGUFs8AMtXtew4twe-DGaAMoiz5__noPt4-Pvz8iMoeVBqUdPCv9Anv9Ak6DbaVw4PYcDLeddKC34PbCgm65oU4bhGOURfCy5wocNTvuvHGURYcie8qS0OdNoiyi3PqPW05dZzhoNT31ZnD1XijRUAmPvDW67ti503vnWovIHOE1wuudrist3VSbHcLrHwiv_0i29-Zf6R8PH7W9_FLXfNSTRf2vlH1DzbdCcfiuRQ0oibYIF60zgHAaIVwCyhf9c4uFhwi34HuXgMgKGJUSEFkWcACRJYjcehEpvzfTQ5FNKbdK-GvN2TSNMcLF2cNkKbIEcoSX8Cs35Nbf_3Pa5dFz67Th54ZwuvSPv8dtCVSKnYIsOX7PcBdiPIxCvhoNClnAulNh7GHunPEDDkr76FaUPYPSW8M5KG1fFQOlO_UilM9tKQ13nVHQ8EabV4QLpRV_4605k_Qj718YoQ9hDUmBSXTKT50zouoct6ErZAbKF7_mAbwH6Zizl1N847yBL4ayy5nOtLJaDn0bP7-_cua0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