[LLVMdev] Force register allocator to spill all variables of a basic block

Ronaldo Ferreira ronaldorferreira at gmail.com
Thu Apr 10 13:37:02 PDT 2014


Hi,

I need to force all variables of a basic block to spill, i.e., I can't
allow basic blocks to share registers. I would like to know where is the
most appropriate approach to implement that policy in LLVM.

Looking at the LLVM source, it seems that the register allocator is the
best choice because it controls the spilling, but I need to guarantee that
this policy is not violated by post RA passes.

To illustrate the policy, let us suppose two BBs A and B:

BB A:
    a = x + y

BB B:
    b = a * x

In a pseudo machine code, I need to generate this:

BB A:
    load x;
    load y;
    add a, x, y
    store a

BB B:
    load a;
    load x;
    mul b, a, x;
    store b;


Any help is much appreciated!

Thanks,
Ronaldo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140410/ac8772d3/attachment.html>


More information about the llvm-dev mailing list