<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/77055>77055</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
GlobalISel: bfloat vector arguments that require splitting assert in IRTranslator
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AMDGPU,
llvm:globalisel
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
arsenm
</td>
</tr>
</table>
<pre>
```
# RUN: llc -global-isel -march=amdgcn -mcpu=gfx900 < %s
define void @fail(<4 x bfloat> %arg0) {
ret void
}
```
```
Assertion failed: ((TypeSize::ScalarTy)SrcOps.size() * SrcOps[0].getLLTTy(*getMRI()).getSizeInBits() == DstOps[0].getLLTTy(*getMRI()).getSizeInBits() && "input scalars do not exactly cover the output vector register"), function buildInstr, file MachineIRBuilder.cpp, line 1305.
Process 40303 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
frame #4: 0x0000000104b7320c llc`llvm::MachineIRBuilder::buildInstr(this=0x0000600000375540, Opc=68, DstOps=ArrayRef<llvm::DstOp> @ 0x000000016fdf8ba0, SrcOps=ArrayRef<llvm::SrcOp> @ 0x000000016fdf8b90, Flags= Has Value=false ) at MachineIRBuilder.cpp:1302:5
1299 SrcOps[0].getLLTTy(*getMRI());
1300 }) &&
1301 "type mismatch in input list");
-> 1302 assert((TypeSize::ScalarTy)SrcOps.size() *
1303 SrcOps[0].getLLTTy(*getMRI()).getSizeInBits() ==
1304 DstOps[0].getLLTTy(*getMRI()).getSizeInBits() &&
1305 "input scalars do not exactly cover the output vector register");
Target 0: (llc) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
frame #0: 0x000000018f46d11c libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x000000018f4a4cc0 libsystem_pthread.dylib`pthread_kill + 288
frame #2: 0x000000018f3b4a40 libsystem_c.dylib`abort + 180
frame #3: 0x000000018f3b3d30 libsystem_c.dylib`__assert_rtn + 284
* frame #4: 0x0000000104b7320c llc`llvm::MachineIRBuilder::buildInstr(this=0x0000600000375540, Opc=68, DstOps=ArrayRef<llvm::DstOp> @ 0x000000016fdf8ba0, SrcOps=ArrayRef<llvm::SrcOp> @ 0x000000016fdf8b90, Flags= Has Value=false ) at MachineIRBuilder.cpp:1302:5
frame #5: 0x00000001049c147c llc`llvm::CSEMIRBuilder::buildInstr(this=0x0000600000375540, Opc=68, DstOps=ArrayRef<llvm::DstOp> @ 0x000000016fdf8fa0, SrcOps=ArrayRef<llvm::SrcOp> @ 0x000000016fdf8f90, Flag= Has Value=false ) at CSEMIRBuilder.cpp:299:25
frame #6: 0x0000000104b6e0dc llc`llvm::MachineIRBuilder::buildBuildVector(this=0x0000600000375540, Res=0x000000016fdf9628, Ops=ArrayRef<llvm::Register> @ 0x000000016fdf9208) at MachineIRBuilder.cpp:695:10
frame #7: 0x00000001049c80a4 llc`buildCopyFromRegs(B=0x0000600000375540, OrigRegs=ArrayRef<llvm::Register> @ 0x000000016fdf9ce8, Regs=ArrayRef<llvm::Register> @ 0x000000016fdf9cd0, LLTy=(IsScalar = 0, IsPointer = 0, IsVector = 1, RawData = 1048580), PartLLT=(IsScalar = 1, IsPointer = 0, IsVector = 0, RawData = 32), Flags=const llvm::ISD::ArgFlagsTy @ 0x000000016fdf9cb0) at CallLowering.cpp:482:17
frame #8: 0x00000001049c5df4 llc`llvm::CallLowering::handleAssignments(this=0x00006000022700e0, Handler=0x000000016fdfa4b8, Args=0x000000016fdfa750, CCInfo=0x000000016fdfba60, ArgLocs=0x000000016fdfbbd8, MIRBuilder=0x0000600000375540, ThisReturnRegs=ArrayRef<llvm::Register> @ 0x000000016fdfa250) const at CallLowering.cpp:829:7
frame #9: 0x0000000100951680 llc`llvm::AMDGPUCallLowering::lowerFormalArguments(this=0x00006000022700e0, B=0x0000600000375540, F=0x0000600001260008, VRegs=ArrayRef<llvm::ArrayRef<llvm::Register> > @ 0x000000016fdfa6a0, FLI=0x000000013700bde8) const at AMDGPUCallLowering.cpp:729:8
frame #10: 0x0000000104aa0acc llc`llvm::IRTranslator::runOnMachineFunction(this=0x000000013700ba00, CurMF=0x0000000137819c00) at IRTranslator.cpp:3637:13
frame #11: 0x0000000103282fa8 llc`llvm::MachineFunctionPass::runOnFunction(this=0x000000013700ba00, F=0x0000600001260008) at MachineFunctionPass.cpp:93:13
frame #12: 0x0000000103a9b4a4 llc`llvm::FPPassManager::runOnFunction(this=0x0000000136e05960, F=0x0000600001260008) at LegacyPassManager.cpp:1443:27
frame #13: 0x000000010282f4b4 llc`(anonymous namespace)::CGPassManager::RunPassOnSCC(this=0x0000000136e04e60, P=0x0000000136e05960, CurSCC=0x000000016fdfd930, CG=0x0000600002e7e1f0, CallGraphUpToDate=0x000000016fdfd89e, DevirtualizedCall=0x000000016fdfd913) at CallGraphSCCPass.cpp:180:25
frame #14: 0x000000010282e0b0 llc`(anonymous namespace)::CGPassManager::RunAllPassesOnSCC(this=0x0000000136e04e60, CurSCC=0x000000016fdfd930, CG=0x0000600002e7e1f0, DevirtualizedCall=0x000000016fdfd913) at CallGraphSCCPass.cpp:470:9
frame #15: 0x000000010282cd54 llc`(anonymous namespace)::CGPassManager::runOnModule(this=0x0000000136e04e60, M=0x0000000148005990) at CallGraphSCCPass.cpp:535:18
frame #16: 0x0000000103a9bd54 llc`(anonymous namespace)::MPPassManager::runOnModule(this=0x00000001480063b0, M=0x0000000148005990) at LegacyPassManager.cpp:1558:27
frame #17: 0x0000000103a9b8d0 llc`llvm::legacy::PassManagerImpl::run(this=0x0000000147814000, M=0x0000000148005990) at LegacyPassManager.cpp:541:44
frame #18: 0x0000000103aa2820 llc`llvm::legacy::PassManager::run(this=0x000000016fdfe190, M=0x0000000148005990) at LegacyPassManager.cpp:1685:14
frame #19: 0x000000010000792c llc`compileModule(argv=0x000000016fdfef58, Context=0x000000016fdfebb8) at llc.cpp:749:8
frame #20: 0x0000000100005d44 llc`main(argc=8, argv=0x000000016fdfef58) at llc.cpp:425:22
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWVtv2zoS_jX0CxGDIqnbgx8c-7jHQLINnLSvASXRMrfU5ZBUTn1-_YKUlDi6pGla7L5sUDQOh_Nx5psLRxbTWuQl5yvgXwN_u2CNOVVqxZTmZbFIquy8AgHq_qEtQGuACTx8-RcgayhlCq9yWSVMXgnNJbwqmEpPgGxZkeVpCa-KtG4A2ebH7zFCEJANBNjXHZD7P-NHUXL4VIkMAoqOTEiAI0A2FH6HyVFWzADyh1VjKkcAxxCE160qhIobp9kBhttL5KHd86K11lwZUZXQHs8z65s1AkcP55rfi384IGtA1vcpk0w9nAGO71X6udZLbWV2ZwwBXsN2FfjXCPjbZc7Nzc2D3R4BvM65uT3s280Ax1ZqkffltTC6xyBbQLZwq82vweAA4AACjEVZNwZqZ7eGWQXLykD-naVGnmFaPXEFzYnDqjF23xNPTaWg4rnQhiuAsTtkA49NmTp-kkbIbF9qo9yykBzesvQkSr4_XFsZV8u0rq1Q2rB6BPnLluQ7VaVca0gRQQRqU9U17wOH19CcFGcZBJh4Vvuvhjfc8gEBDtOqWLK6lnxZMFFetVsBDu1GCwQVZ7oq3faTMLBWVa5YAZmLa5csR8UKbvGpDS_6jtofD9EkJBilNptBgKR8KtpoDx1rVy8ZiMxJaEC2LVjg8Ejo-xRZyz7XKSDbILKfu4iS7Vopdj7wIyCbl5Oc1GU5RReWBcfsGCXMgXWZNQPgpHMAsQPYSZZbffgn0_Arkw0HZHtkUltOYsjMdCDJ2iMIA7L2-5qDHo5jgOKfSXZArl_UCUJWfebHFvFzCndKHkHeaxWAsTnXHBZCF8ykJyhK2Oa6FNp0idsfemWZcW6guM-JD1T3pQfkJwl4o9ovYamF_T3VfwnrW9jf1A16Uh-YyrmBqOuVtnhw3Jf1sq_rSMossYLE_BdLHcKXakevqz060iDzvBRKkeizNrx4_MZVyeUyO0uRgAA9PtbtqY_fhJQQ4GsYTeB6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