<div>Hi all,</div>
<div> </div>
<div>I am writing a llvm backend for a small stream processor. Because of its special application field, the processor does not support function. When I built the llvm backend for the new target, I leave the calling convention and frame lowering part blank. It compilered correctly, but I encountered execution errors, like </div>
<div> </div>
<div><em>[xxx@localhost ex]$ llc test.ll -march=SSP -o test.s<br>0 llc 0x08f7ee49<br>1 llc 0x08f7f41a<br>2 0x003b1420 __kernel_sigreturn + 0<br>3 llc 0x08de0d52 llvm::TargetData::getAlignment(llvm::Type const*, bool) const + 44<br>
4 llc 0x08de108a llvm::TargetData::getABITypeAlignment(llvm::Type const*) const + 44<br>5 llc 0x0863e289 llvm::TargetData::getTypeAllocSize(llvm::Type const*) const + 37<br>6 llc 0x08a707ed llvm::GetReturnInfo(llvm::Type const*, unsigned int, llvm::SmallVectorImpl<llvm::ISD::OutputArg>&, llvm::TargetLowering const&, llvm::SmallVectorImpl<unsigned long long>*) + 573<br>
7 llc 0x089b59be llvm::FunctionLoweringInfo::set(llvm::Function const&, llvm::MachineFunction&) + 156<br>8 llc 0x08a4ec8a llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 280<br>
9 llc 0x08b7c191 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 89<br>10 llc 0x08eb92f1 llvm::FPPassManager::runOnFunction(llvm::Function&) + 315<br>11 llc 0x08eb94bb llvm::FPPassManager::runOnModule(llvm::Module&) + 121<br>
12 llc 0x08eb8fbf llvm::MPPassManager::runOnModule(llvm::Module&) + 413<br>13 llc 0x08eba3b0 llvm::PassManagerImpl::run(llvm::Module&) + 124<br>14 llc 0x08eba415 llvm::PassManager::run(llvm::Module&) + 39<br>
15 llc 0x0859a610 main + 2470<br>16 libc.so.6 0x0097de9c __libc_start_main + 220<br>17 llc 0x08598b61<br>Stack dump:<br>0. Program arguments: llc test.ll -march=SSP -o test.s <br>1. Running pass 'Function Pass Manager' on module 'test.ll'.<br>
2. Running pass 'SSP DAG->DAG Pattern Instruction Selection' on function '@add'<br>Segmentation fault<br></em></div>
<div>I think the error comes from the lacking support of function call. Should I write some fake codes to walk around, or I have some ways to tell LLVM that I do not want function call?</div>
<div> </div>
<div>Actually, I tried to write LLVM IR without the function form of define @main(..., but with function body directly. Unfortunately, everything seems must work with a function call, otherwise llc will not work.</div>
<div> </div>
<div> </div>
<div>Best wishes!</div>