[LLVMdev] Tool for loop transformations

Tomáš Heger heger.tomas at gmail.com
Tue Apr 24 14:19:34 PDT 2012


Hi everyone!

I would like to create a tool which would "simulate" several loop 
transformations. It should serve as a part of my bachelor thesis.

Typical usage of that tool would be this:
Mark a loop in a source (probably C/C++) file and specify desired 
transformation in a predefined way (for example a special comment or 
something). -> Run the tool on that "crafted" source file. -> Watch the 
result (which should be in an input language or possibly in LLVM IR).

I know that LLVM can do some of the loop transformations but as far as I 
know it decides itself what transformation (if any) will be done. Or am 
I mistaken? Is it possible to specify which loop is supposed to be 
transformed and how? Is it easily possible to get the (above mentioned) 
mark through the compiler frontend so it would appear in the LLVM IR as 
well? Then maybe I could write my own pass and use the `opt` command to 
run it on the .ll file and watch it before and after the pass. Am I 
mistaken? Is there a better way?

Do you understand what I want to achieve? Is LLVM suitable for my needs? 
What should I read? Where should I start? What would you advise me?

Thanks for all your answers and ideas.

-- 
Regards,
Tomas Heger




More information about the llvm-dev mailing list