I’ve been trying to follow these instructions, but for RISCV.
Specifically, this line:
if local_demo:
target = 'llvm'
else:
target = 'llvm -target=armv7l-linux-gnueabihf'
The instructions said these options correspond to llc and will recognize -mcpu
, -mtriple
, etc, so I tried this:
# target = 'llvm -target=riscv64-unknown-linux -mtriple=riscv64 -mcpu=generic-rv64 -mattr=+64bit,a,c,d,f,m'
However I get this error:
'generic' is not a recognized processor for this target (ignoring processor)
'generic' is not a recognized processor for this target (ignoring processor)
'generic' is not a recognized processor for this target (ignoring processor)
'generic' is not a recognized processor for this target (ignoring processor)
'generic' is not a recognized processor for this target (ignoring processor)
'generic' is not a recognized processor for this target (ignoring processor)
[15:35:11] /home/asamara/tvm/src/codegen/llvm/codegen_llvm.cc:75: Set native vector bits to be 128 for riscv64
LLVM ERROR: Cannot select: 0x22c7228: ch = brcond 0x22a3438, 0x22c6e18, BasicBlock:ch<assert_end 0x22bc260>
0x22c6e18: i64 = setcc 0x22c7430, Constant:i64<2>, seteq:ch
0x22c7430: i64 = and 0x22c6fb8, Constant:i64<4294967295>
0x22c6fb8: i64,ch = CopyFromReg 0x22a3438, Register:i64 %14
0x22c6f50: i64 = Register %14
0x22c73c8: i64 = Constant<4294967295>
0x22c6db0: i64 = Constant<2>
In function: addone
And when I try the 32-bit version I get this:
'generic' is not a recognized processor for this target (ignoring processor)
'generic' is not a recognized processor for this target (ignoring processor)
'generic' is not a recognized processor for this target (ignoring processor)
'generic' is not a recognized processor for this target (ignoring processor)
'generic' is not a recognized processor for this target (ignoring processor)
'generic' is not a recognized processor for this target (ignoring processor)
[15:41:12] /home/asamara/tvm/src/codegen/llvm/codegen_llvm.cc:75: Set native vector bits to be 128 for riscv32
LLVM ERROR: Unable to lowerGlobalAddress
It looks like these errors are coming from a bug in LLVM, but I can’t be sure, is this even the correct way to deploy it?