<div dir="ltr">Hello again,<div><br></div><div>I seem to have managed to fix the last error message a couple of days ago.</div><div><br></div><div>However, I right afterwards I got the following error:</div><div><br></div><div>$ ../bin/llc -mtriple=via64 call1.ll <br>> LLVM ERROR: Cannot select: t10: ch,glue = callseq_end t9, TargetConstant:i64<0>, TargetConstant:i64<0>, t9:1<br>>   t4: i64 = TargetConstant<0><br>>   t4: i64 = TargetConstant<0><br>>   t9: ch,glue = VIA64ISD::CALL t5, t7, RegisterMask:Untyped<br>>     t7: i64 = MOVId TargetGlobalAddress:i64<void ()* @function2> 0 [TF=1]<br>>       t6: i64 = TargetGlobalAddress<void ()* @function2> 0 [TF=1]<br>>     t8: Untyped = RegisterMask<br>> In function: test_call_external2<br></div><div><br></div><div>I have been trying to find out what exactly the problem is for a couple of days now and I am getting a little desperate.</div><div>Does anyone with more experience in tblgen know what exactly I have to implement to lower callseq_end?</div><div><br></div><div>If this isn't the right place to ask these questions please let me know.</div><div><br></div><div>Cheers,</div><div>Floris</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 11 Apr 2020 at 14:01, floris westermann <<a href="mailto:westermann.floris@gmail.com">westermann.floris@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi everyone,<div><br></div><div>I am currently working on a backend for my bachelor thesis, using the patches by alex bradbury as a reference (<a href="https://github.com/lowRISC/riscv-llvm" target="_blank">https://github.com/lowRISC/riscv-llvm</a>).</div><div><br></div><div>However, whenever I try to lower the following file:</div><div><br></div><div>play/call.ll:</div><div>> declare i32 @external_function(i64)<br><br>> define i32 @test_call_external(i64 %a) nounwind {<br>>   %1 = add i64 %a, %a<br>>   %2 = call i32 @external_function(i64 %1)<br>>   ret i32 %2<br>> }<br></div><div><br></div><div>with </div><div>$ ./bin/llc -mtriple=via64 play/call.ll</div><div><br></div><div>TargetRegisterInfo::getMinimalPhysRegClass() fails because it could find an appropriate Register Class.</div><div>I put a copy of the stack dump at the bottom.<br></div><div><br></div><div>The register i am passing should be i64 (i checked at runtime, and it is).</div><div>And my defined registers are all 64 bit as well. </div><div><br></div><div>Does anyone know what could be wrong?</div><div>I understand that this is probably not enough information to answer my question, but I didn't exactly know what code to send.</div><div><br></div><div>Cheers,</div><div>Floris Westermann</div><div><br></div><div><br></div><div>Stack dump:</div><div><br></div><div>> $ ./bin/llc -mtriple=via64 play/call.ll</div><div>><br>> llc: ../lib/CodeGen/TargetRegisterInfo.cpp:208: const llvm::TargetRegisterClass *llvm::TargetRegisterInfo::getMinimalPhysRegClass(unsigned int, llvm::MVT) const: Assertion `BestRC && "Couldn't find the register class"' failed.<br>> Stack dump:<br>> 0.       Program arguments: ./bin/llc -mtriple=via64 play/call.ll <br>> 1.      Running pass 'Function Pass Manager' on module 'play/call.ll'.<br>> 2. Running pass 'VIA64 DAG->DAG Pattern Instruction Selection' on function '@test_call_external'<br>>  #0 0x00007f5dfb508709 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/fooris/github/llvm/build/../lib/Support/Unix/Signals.inc:544:11<br>>  #1 0x00007f5dfb5088b9 PrintStackTraceSignalHandler(void*) /home/fooris/github/llvm/build/../lib/Support/Unix/Signals.inc:605:1<br>>  #2 0x00007f5dfb5070b6 llvm::sys::RunSignalHandlers() /home/fooris/github/llvm/build/../lib/Support/Signals.cpp:67:5<br>>  #3 0x00007f5dfb50904d SignalHandler(int) /home/fooris/github/llvm/build/../lib/Support/Unix/Signals.inc:391:1<br>>  #4 0x00007f5dfa275890 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)<br>>  #5 0x00007f5df9571e97 raise /build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0<br>>  #6 0x00007f5df9573801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0<br>>  #7 0x00007f5df956339a __assert_fail_base /build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0<br>>  #8 0x00007f5df9563412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)<br>>  #9 0x00007f5dfe84376a llvm::TargetRegisterInfo::getMinimalPhysRegClass(unsigned int, llvm::MVT) const /home/fooris/github/llvm/build/../lib/CodeGen/TargetRegisterInfo.cpp:209:10<br>> #10 0x00007f5dfbace437 CheckForPhysRegDependency(llvm::SDNode*, llvm::SDNode*, unsigned int, llvm::TargetRegisterInfo const*, llvm::TargetInstrInfo const*, unsigned int&, int&) /home/fooris/github/llvm/build/../lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp:133:32<br>> #11 0x00007f5dfbacdfeb llvm::ScheduleDAGSDNodes::AddSchedEdges() /home/fooris/github/llvm/build/../lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp:487:9<br>> #12 0x00007f5dfbace492 llvm::ScheduleDAGSDNodes::BuildSchedGraph(llvm::AAResults*) /home/fooris/github/llvm/build/../lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp:538:1<br>> #13 0x00007f5dfbab9d05 (anonymous namespace)::ScheduleDAGRRList::Schedule() /home/fooris/github/llvm/build/../lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:0:3<br>> #14 0x00007f5dfbacbcfd llvm::ScheduleDAGSDNodes::Run(llvm::SelectionDAG*, llvm::MachineBasicBlock*) /home/fooris/github/llvm/build/../lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp:64:1<br>> #15 0x00007f5dfbbe0d70 llvm::SelectionDAGISel::CodeGenAndEmitDAG() /home/fooris/github/llvm/build/../lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:986:16<br>> #16 0x00007f5dfbbdf3e0 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/fooris/github/llvm/build/../lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:735:1<br>> #17 0x00007f5dfbbdeecd llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /home/fooris/github/llvm/build/../lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:0:7<br>> #18 0x00007f5dfbbdc278 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/fooris/github/llvm/build/../lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:502:22<br>> #19 0x00007f5dfe50b4a2 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/fooris/github/llvm/build/../lib/CodeGen/MachineFunctionPass.cpp:73:8<br>> #20 0x00007f5dfd9998ac llvm::FPPassManager::runOnFunction(llvm::Function&) /home/fooris/github/llvm/build/../lib/IR/LegacyPassManager.cpp:1648:23<br>> #21 0x00007f5dfd999cc5 llvm::FPPassManager::runOnModule(llvm::Module&) /home/fooris/github/llvm/build/../lib/IR/LegacyPassManager.cpp:1684:16<br>> #22 0x00007f5dfd99a444 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/fooris/github/llvm/build/../lib/IR/LegacyPassManager.cpp:1749:23<br>> #23 0x00007f5dfd999f58 llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/fooris/github/llvm/build/../lib/IR/LegacyPassManager.cpp:1862:16<br>> #24 0x00007f5dfd99a9d1 llvm::legacy::PassManager::run(llvm::Module&) /home/fooris/github/llvm/build/../lib/IR/LegacyPassManager.cpp:1893:3<br>> #25 0x000000000041fb11 compileModule(char**, llvm::LLVMContext&) /home/fooris/github/llvm/build/../tools/llc/llc.cpp:605:41<br>> #26 0x000000000041e19d main /home/fooris/github/llvm/build/../tools/llc/llc.cpp:355:13<br>> #27 0x00007f5df9554b97 __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0<br>> #28 0x000000000041d8da _start (./bin/llc+0x41d8da)<br>> [1]    24145 abort      ./bin/llc -mtriple=via64 play/call.ll<br></div></div>
</blockquote></div>