<div dir="ltr"><div><div><div><div>Hi,<br><br></div>I'm trying to compile the basicmath benchmark from the MiBench suite to the MIPS target. However, when I call llc with the linked llvm bitcode, the compilation gives an error apparently related to some unsupported feature. The same error occurs when I select -march=arm, but it works for X86. In details:<br>
<br></div>Commands I used to compile basicmath:<br><br>clang -static -O3 basicmath_small.c rad2deg.c cubic.c isqrt.c -c -emit-llvm<br>llvm-link basicmath_small.bc rad2deg.bc cubic.bc isqrt.bc -o basicmath.bc<br>llc basicmath.bc -march=mipsel -relocation-model=static -o basicmath<br>
<br></div>The error is:<br><br>llc: /home/ronaldo/llvm/include/llvm/Target/TargetLowering.h:302: virtual const llvm::TargetRegisterClass* llvm::TargetLoweringBase::getRegClassFor(llvm::MVT) const: Assertion `RC && "This value type is not natively supported!"' failed.<br>
0 llc 0x0000000001557f2d llvm::sys::PrintStackTrace(_IO_FILE*) + 38<br>1 llc 0x00000000015581aa<br>2 llc 0x0000000001557b50<br>3 libpthread.so.0 0x00007f2d54c26340<br>4 libc.so.6 0x00007f2d53e62f79 gsignal + 57<br>
5 libc.so.6 0x00007f2d53e66388 abort + 328<br>6 libc.so.6 0x00007f2d53e5be36<br>7 libc.so.6 0x00007f2d53e5bee2<br>8 llc 0x00000000009be707<br>9 llc 0x0000000000cfed54 llvm::FunctionLoweringInfo::CreateReg(llvm::MVT) + 64<br>
10 llc 0x0000000000cfeebd llvm::FunctionLoweringInfo::CreateRegs(llvm::Type*) + 337<br>11 llc 0x0000000000cf33fa<br>12 llc 0x0000000000cfe4cb llvm::FunctionLoweringInfo::set(llvm::Function const&, llvm::MachineFunction&, llvm::SelectionDAG*) + 2033<br>
13 llc 0x0000000000dadb1d llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 921<br>14 llc 0x0000000000b01037 llvm::MipsDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 35<br>
15 llc 0x0000000000b2a9a1 llvm::MipsSEDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 65<br>16 llc 0x0000000000fcd6ed llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 95<br>
17 llc 0x00000000014d0825 llvm::FPPassManager::runOnFunction(llvm::Function&) + 291<br>18 llc 0x00000000014d09d0 llvm::FPPassManager::runOnModule(llvm::Module&) + 84<br>19 llc 0x00000000014d0cee<br>
20 llc 0x00000000014d13b8 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 244<br>21 llc 0x00000000014d15c3 llvm::legacy::PassManager::run(llvm::Module&) + 39<br>22 llc 0x00000000008c4893<br>
23 llc 0x00000000008c3ac3 main + 237<br>24 libc.so.6 0x00007f2d53e4dec5 __libc_start_main + 245<br>25 llc 0x00000000008c1589<br>Stack dump:<br>0. Program arguments: ../../../sw/llc basicmath.bc -march=mipsel -relocation-model=static -o basicmath <br>
1. Running pass 'Function Pass Manager' on module 'basicmath.bc'.<br>2. Running pass 'MIPS DAG->DAG Pattern Instruction Selection' on function '@SolveCubic'<br>Aborted (core dumped)<br>
<br><br></div>Am I missing something in the compilation?<br></div>