Monday, January 15, 2007

Bug solved :)

The bug from January 13 has been solved. The problem was that I was using a value to small as the maximum spilling factor of any register. Result: it happened that all the registers had bigger spilling factors, and no register could be spilled. Silly. Now the spilling factor is 2147483647, the biggest unsigned int in my mac.

Saturday, January 13, 2007

Bugs

There is a bug when compiling the benchmark cdecl. To compile the program with LLVM's linear scan, follow these steps:

llvm-gcc cdecl.c -o cdecl
llc -f -regalloc=linearscan cdecl.bc -o ln.s
gcc ln.s -o exec
./exec cdlex.l.in

To compile the program with the SSA-based allocator, do as follow:

llvm-gcc cdecl.c -o cdecl
llc -f -regalloc=chordal cdecl.bc -o ch.s
gcc ch.s -o exec
./exec cdlex.l.in

The output produced by the different allocators is not the same.

Another problem that I am having is in the compilation of sim.c (llvm/projects/llvm-test/MultiSource/Benchmarks/sim). The compilation/execution of this file is a little tricky because of the input tag in the llvm line:

llvm-gcc -DUNIX sim.c -o sim
llc -f -regalloc=linearscan sim.bc -o ln.s
gcc ln.s -o exec
./exec

The bug happens during compilation. When I invoke llc -f -regalloc=chordal sim.bc -o ch.s I get a compilation error.