[LLVMdev] extending LLVM - basic block reordering
jtcriswel at gmail.com
Mon Oct 6 16:17:04 PDT 2014
To reorder basic blocks, all you need to do is to write an LLVM pass
that changes the order that the block appear within the list of basic
blocks that belong to the function. The only block you can't reorder is
the entry block which, I think, always needs to be the first basic block
in the list.
The first thing you should do is read the document "Writing an LLVM
Pass" (http://llvm.org/docs/WritingAnLLVMPass.html). You should also
read the "LLVM Programmer's Manual"
(http://llvm.org/docs/ProgrammersManual.html). To look up specific
information on LLVM classes, use doxygen
The first coding task would be to write a skeleton FunctionPass and run
it through the opt program. After that, you should be able to add code
to your FunctionPass to reorder the basic blocks within a function.
On 10/5/14, 11:34 AM, Zahra fatehi marj wrote:
> I want to change order of code basic blocks in memory. I visited
> "http://llvm.org/docs/ExtendingLLVM.html" page and it advised me
> to ask it before any effort.
> What parts of LLVM help me and how? I am a newbie on LLVM.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
Department of Computer Science, University of Rochester
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev