Saturday, June 24, 2006

First program compiled!

Nothing like gdb! I have used it today to debug my register allocation pass. To the guy who coded gdb: I love you! To use gdb in LLVM is the same as in any other application. First gdb llc. After that, try run -f hello.bc -o result.s. The problem of my pass was that I was not setting the vector that marks the physical registers used. In my opinion, LLVM should assert that the size of this vector is the size of the number of physical registers that need to be used. Maybe I can ask this for the LLVM guys. To compile a program, I am using this sequence of commands:

llvm-gcc file.c -o file
llc -f file.bc -o chordal.s
gcc chordal.s -o file.exe
./file.exe [params]

To make life easier, I have this script. I will be storing the files that I can compile correctly in this directory. I still have to remove some pesky move instructions. The code generated by linear scan, or local allocation (built in in LLVM) does not have those instructions. I think it is because they are using this "Two address instruction pass".

0 Comments:

Post a Comment

<< Home