I am trying to build against the latest LLVM source from GitHub (from Jan 23 2021) my research processor back end, which is mostly inspired from the BPF LLVM back end. While trying this, I got this error that I didn't encounter until now:
<<LLVM ERROR: Inline asm not supported by this streamer because we don't have an asm parser for this target"
llvm::AsmPrinter::emitInlineAsm(llvm::StringRef, llvm::MCSubtargetInfo const&, llvm::MCTargetOptions const&, llvm::MDNode const*, llvm::InlineAsm::AsmDialect) const llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp:156:9>>
Again, this is the first time I encounter this error. It is true I am using quite a bit inline assembly expressions to print some special strings which actually do not represent assembler instructions of the processor.
My back end is inspired heavily from the BPF back end but in 2015, when I started my back end, BPF did not have an AsmParser folder. Do you recommend to get inspired from the the current AsmParser folder of the BPF back end?
Any suggestion is warmly welcome.
If ever, my LLVM back end can be found here: https://sites.google.com/site/alexsusu/myfilecabinet/Connex_be.zip .
Just to mention, I found some documentation about AsmParser from around 2012: Howto: Implementing LLVM Integrated Assembler .
Thank you very much,
Can somebody please help me with the error reported in this thread?
It seems that some changes were made from LLVM 8 (from 2019) to the current LLVM, such that there is no longer a default(?) MCTargetAsmParser and I need to implement one in my back end.
There is one more issue that I wrote of in the previous message also: I create inline assembly expressions in the back end to print some special strings (like "N/M", which is an arithmetic expression), which actually do not represent assembler instructions of the processor. Therefore, I guess I should have an Asm Parser that should not bother to parse the arithmetic expression strings because they do not contains assembler mnemonics.
Thank you very much,
<<LLVM ERROR: Inline asm not supported by this streamer because we don't have an asm
parser for this target"
If you can't parse assembly at all, you should probably be running in
no-integrated-asm mode. That should cause the function to terminate
early after just printing the raw text in this case.
Exactly how to get into that mode varies by tool. In Clang it's
-fno-integrated-as. llc accepts -no-integrated-as, and I have no idea
about any others. It looks like TargetOptions::DisableIntegratedAS
might allow you to hard-code it for your backend, but I've never been
in a position to try that.
Tim, thank you very much for pointing me to the no-integrated-asm mode of LLVM. I used llc -no-integrated-as ... and it fixed my problem completely.
I remain indebted for your answer.