[LLVMdev] Best way to generate Pseudo-Registers in target language?

ryan baird ryanrbaird at gmail.com
Sat Sep 15 09:00:28 PDT 2012

I'm working on a target for the intermediate language of another compiler,
and the other compiler does it's own register allocation.  In the other
imediate language, the pseudo-registers are not live across basic blocks;
Anything value that is live accross basic blocks should be put on the stack
frame, and when the other compiler's register allocation occurs it will be
taken back out of the stack frame.

In case it helps answer my question, the code I'm working on is a modified
copy of the MIPS target, because it looked like it would be easier to
modify the MIPS target than to start from scratch.  Right now the project
is being developed on LLVM 3.1.

So here's the question. From the looks of it, I need to write a pass that
looks through the basic blocks, finds any registers that get written,
checks if they get used in other blocks (before being written to again),
and if so, inserts the necessary loads and stores.  Is there a better way
to do this?  If not, what would be the best place do this pass?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120915/0486922e/attachment.html>

More information about the llvm-dev mailing list