Reputation: 612
I am trying to find some code examples which allow me to hook up a llvm backend for code generation. For example, hooking up the IR to either the Mips or Sparc backend. However, I haven't been able to find any such examples. The only closest thing I could find is the use of the AMD IL & GPU backend, currently in the mesa tree but not yet merged into the llvm backend. I have read the Writing an LLVM Backend tutorial but its not really obvious to me as to how to hook up the backend. I am sure I am missing something from the examples so could someone point me to some examples for this ? I already have code to generate the IR. Thanks
Upvotes: 2
Views: 945
Reputation: 1107
The llc command would compile LLVM IR to target machine assembly. With argument "march=[your target]", you can get assembly for different targets, "march=mips" for Mips, for example.
Upvotes: 1
Reputation: 19965
You might want to look at the LLVM llc command. It reads a bitcode IR file and calls any of the backends on it.
Upvotes: 1