[LLVMdev] Extracting loop body
paul.redmond at intel.com
Tue Apr 3 11:13:25 CDT 2012
I've seen this question asked before but I haven't seen an answer..
I would like to extract the body of a (for) loop into a new function so I can do some transformations. The function ExtractCodeRegion seemed like a good candidate and I've got it to sort of work.
My problem is that ExtractCodeRegion creates a function that still contains a loop. I was able to eliminate the loop by manually splitting the blocks of the original loop body after and before induction variable uses (hard code the instructions to split on)
My question is, how can I reliably/more generally split the blocks of the loop body to avoid a loop in the extracted code region? Also, I should mention that in the presence of nested loops I would like to leave the inner loops intact.
Has anyone done anything similar or perhaps there is something obvious I am missing?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the LLVMdev