pbqp register allocator-need help

Hello Sir,

Im trying to test run pbqp register allocator for small C programs.

by

llc -regalloc=pbqp -debug

It is giving me segmentation fault for even very simple programs having loops or if statements.

Please tell me where I’m going wrong.

Could you provide a specific example file (preferably a particularly simple
one) that reproduces this problem? (along with the exact command line)

if you can repro this crash with C source and Clang, the Clang crash
reporting mechanisms (it will provide a .sh and .i file & instruct you to
attach those files to a bug report) are quite handy when reporting bugs.

The simple C code on which im running the allocator is attached.

And these are the set of commands. I dont understand …guess i might be doing something very silly.

Please help

Commands:

clang -emit-llvm -c test.c -o test.bc

opt -mem2reg test.bc -o testssa.bc

llc -regalloc=pbqp testssa.bc

test.c (81 Bytes)

Hi Smriti,

What version of LLVM are you using? Unfortunately there was a bug in the PBQP allocator in 3.2 and 3.3 LLVM releases. This bug has been corrected in the development branch.

If you’re building LLVM from source you can fix the bug by applying patches r181973 and r185378. These should apply cleanly to the source for LLVM 3.2 and 3.3.

If you’re still having problems please let me know - I’m very happy to help you get this working.

Cheers,
Lang.