[LLVMdev] loop transformation: uniquely identifying a loop within a program

Tatenda M. Chipeperekwa tatenda at cs.ucsd.edu
Fri Nov 11 01:57:52 PST 2011


hi,

thank you for the response, we managed to get all the loops in a given
function using this:


> you can use if (L->getHeader()->getParent()->getNames() ==
> "special_function") check, which will work for all loops.
>
>
As part of the transformation we need to get information about the loops,
and we are using the LoopInfo pass:

LI = &getAnalysis<LoopInfo>();

to get information such as the depth of the loop. We are also manipulating
the IV in some instances e.g. changing the step from say 1 to 2, and we
have implemented this by iterating through all the instructions in a BB. It
seems that the best approach to do this would be to use the
ScalarEvolution, which we have added to our pass:

SE = getAnalysisIfAvailable<ScalarEvolution>();

We been going through the LoopStrengthReduce pass but are unable to
implement this correctly, and to re-write the IR for these cases. Any
pointers on how to do this are appreciated.

Regards,

tatenda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111111/7ffce415/attachment.html>


More information about the llvm-dev mailing list