[LLVMdev] llvmc for PIC16
Sanjiv.Gupta at microchip.com
Sanjiv.Gupta at microchip.com
Sun Jun 7 11:13:51 PDT 2009
Thanks a lot.
This is a great help.
- Sanjiv
-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu on behalf of Mikhail Glushenkov
Sent: Sun 6/7/2009 12:49 PM
To: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] llvmc for PIC16
Hi Sanjiv,
Sanjiv Gupta <sanjiv.gupta <at> microchip.com> writes:
> The salient features that we want to have in the driver are:
> [...]
As promised, I've implemented a basic compiler driver for the
PIC16 toolchain. It's under tools/llvmc/examples/mcc16.
Some examples illustrating the features you requested:
> 2. If the user has specified to generate the final executable, then
> llvm-ld should run on all the .bc files generated by clang and create a
> single optimized .bc file for further tools.
$ mcc16 -dry-run foo.c bar.c
clang-cc foo.c -o /tmp/llvm_6ibgr9/foo.bc
clang-cc bar.c -o /tmp/llvm_6ibgr9/bar.bc
llvm-ld /tmp/llvm_6ibgr9/foo.bc /tmp/llvm_6ibgr9/bar.bc \
-o /tmp/llvm_6ibgr9/tmp.bc
llc -f /tmp/llvm_6ibgr9/tmp.bc -o /tmp/llvm_6ibgr9/tmp.s
native-as /tmp/llvm_6ibgr9/tmp.s -o /tmp/llvm_6ibgr9/tmp.o
native-ld /tmp/llvm_6ibgr9/tmp.o -o a.out
> 3. -Wo <options> - pass optimizations to the llvm-ld
> 4. mcc16 -Wl <options> - pass options to native linker.
> 5. mcc16 -Wa <options> - pass options to native assembler.
$ mcc16 -dry-run -Wo,-opt1 -Wllc,-opt2 -Wa,-opt3 -Wl,-opt4 foo.c
clang-cc foo.c -o /tmp/llvm_92HLCj/foo.bc
llvm-ld -opt1 /tmp/llvm_92HLCj/foo.bc -o /tmp/llvm_92HLCj/tmp.bc
llc -opt2 -f /tmp/llvm_92HLCj/tmp.bc -o /tmp/llvm_92HLCj/tmp.s
native-as -opt3 /tmp/llvm_92HLCj/tmp.s -o /tmp/llvm_92HLCj/tmp.o
native-ld -opt4 /tmp/llvm_92HLCj/tmp.o -o a.out
> $ mcc16 -S foo.c
$ mcc16 -dry-run -S foo.c
clang-cc foo.c -o /tmp/llvm_0uiDCR/foo.bc
llvm-ld /tmp/llvm_0uiDCR/foo.bc -o /tmp/llvm_0uiDCR/foo.bc
llc -f /tmp/llvm_0uiDCR/foo.bc -o foo.s
> $ mcc16 -S foo.c bar.c
$ mcc16 -dry-run -S foo.c bar.c
clang-cc foo.c -o /tmp/llvm_1zAqik/foo.bc
llvm-ld /tmp/llvm_1zAqik/foo.bc -o /tmp/llvm_1zAqik/foo.bc
llc -f /tmp/llvm_1zAqik/foo.bc -o foo.s
clang-cc bar.c -o /tmp/llvm_1zAqik/bar.bc
llvm-ld /tmp/llvm_1zAqik/bar.bc -o /tmp/llvm_1zAqik/bar.bc
llc -f /tmp/llvm_1zAqik/bar.bc -o bar.s
> ** Use of -g causes llvm-ld to run with -disable-opt
> $ mcc16 -S -g foo.c
$ mcc16 -dry-run -S -g foo.c
clang-cc foo.c -o /tmp/llvm_oQFmVn/foo.bc
llvm-ld -disable-opt /tmp/llvm_oQFmVn/foo.bc -o /tmp/llvm_oQFmVn/foo.bc
llc -f /tmp/llvm_oQFmVn/foo.bc -o foo.s
> ** -I is passed to clang-cc, -pre-RA-sched=list-burr to llc.
> $ mcc16 -S -g -I ../include -pre-RA-sched=list-burr foo.c
$ mcc16 -dry-run -S -g -I ../include -pre-RA-sched=list-burr foo.c
clang-cc -I ../include foo.c -o /tmp/llvm_5VxNFQ/foo.bc
llvm-ld -disable-opt /tmp/llvm_5VxNFQ/foo.bc -o /tmp/llvm_5VxNFQ/foo.bc
llc -pre-RA-sched list-burr -f /tmp/llvm_5VxNFQ/foo.bc -o foo.s
This should be enough to get you started.
I'm always happy to answer any further questions you may have. If
you want to e-mail me privately, please use the.dead.shall.rise
<at_sign> gmail dot com for now (our provider problems weren't
resolved yet).
_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090607/c0dac46e/attachment.html>
More information about the llvm-dev
mailing list