llvm backend source

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
cons
New User
Posts: 3
Joined: Sat May 20, 2017 5:11 pm

llvm backend source

Post by cons »

Hello,

I was wondering if the xcore backend on the llvm repo is up-to-date; (there has been no source release since 14.* version).

I have a compiled llvm source tree where the bitcode compiler doesn't understand !xta metadatas, removing all the xta metadata does seem to generate correct assembly code for a test program.

Also it seems there is no way to compile the bitcode file using xcc(xcc1llvm ).

The reason i ask is, it would make easy for other language frontends that target llvm IR to work on xcore platform.


robertxmos
XCore Addict
Posts: 169
Joined: Fri Oct 23, 2015 10:23 am

Post by robertxmos »

Hi cons,
I'm sorry to say it is not.
There are quite a lot of proprietary additions that need to be sanitized before we can request to push upstream.
I can quite understand your frustration but it may be some time before we resync with the main repo.
All I can say is that such work is in our backlog - sorry.
Robert
cons
New User
Posts: 3
Joined: Sat May 20, 2017 5:11 pm

Post by cons »

Hello robert,
Is it atleast possible to make xcc take a bitcode file and output assembly code/binary?
robertxmos
XCore Addict
Posts: 169
Joined: Fri Oct 23, 2015 10:23 am

Post by robertxmos »

Hi cons,
I assume you are referring to the LLVM assembly language format (.ll) or the LLVM bitcode format (.bc).
Yes, it should be possible to feed it into the compiler backend viz llc.
Currently we do not distribute the relevant llc (bugpoint or opt).
I will look into amending this situation ASAP along with documentation on supported meta-data.
(Would you like me to send you the current 9MB llc binary?)

> Also it seems there is no way to compile the bitcode file using xcc(xcc1llvm ).
The xcc is a driver for all the other tools, use '--verbose' to see what it drives (comment added for other readers).
The xcc1llvm compiler can be passed the flag '-emit-llvm' if you only wish to run the front-end (the output could then be passed manually into llc)
You can also use '-On' flags when using -emit-llvm for some early optimisations to be included.
You can pass flags through the xcc driver to one of the tools e.g. '-X compiler-xc -emit-llvm', see 'xcc --help --verbose' for more details.

robert
cons
New User
Posts: 3
Joined: Sat May 20, 2017 5:11 pm

Post by cons »

Hello robert,
Yes, i was aware of -emit-llvm but xcc1llvm didn't accept the bitcode file to generate assembly (what llc would do).

> (Would you like me to send you the current 9MB llc binary?)
Sure. Thanks.
freebroccolo
Newbie
Posts: 1
Joined: Wed Aug 16, 2017 5:56 pm

Post by freebroccolo »

Are there any updates to report about this situation? I am also interested in targeting xcore from another language that uses LLVM but it sounds like this isn't possible at the moment. Are there plans to start distributing llc, etc., with the rest of the tooling?
robertxmos
XCore Addict
Posts: 169
Joined: Fri Oct 23, 2015 10:23 am

Post by robertxmos »

Hi freebroccolo
Future releases will included llc.
There are also plans to get more stuff accepted upstream (lvm.org) in the coming months.
robert
Post Reply