[LLVMdev] Query on 'CodeExtractor'

Nema, Ashutosh Ashutosh.Nema at amd.com
Sun Dec 7 23:33:43 PST 2014


Hi,

I'm implement a pass which identify some loops and extract them to a function.
Tried to use CodeExtractor to extract loop into a newer function.
For top level loop it works perfectly but for inner loop,  it creates trouble just after CodeExtractor when outer loop verification happens.
As newer function call site('codeReplacer') block, is not registered/added to outer loop.
Loop verification aborts with "Loop block has no in-loop successors!".

i.e:

Original

Transformed

OuterLoop
{
     .......
     InnerLoop
     {
          ......
          ......
     }
     ......
}

NewFunction()
{
     InnerLoop
     {
          ......
          ......
     }
}

OuterLoop
{
     ......
     'codeReplacer' Block
             |->   Call to NewFunction
     ......
}


Is CodeExtractor functionality is limited to top level loops only?

I'm expecting CodeExtractor to expose 'codeReplacer' for outside usage (i.e. by providing some getter to class).
Or CodeExtractor to add 'codeReplacer' block as a new member of outer loop when its transforming loops.

Thanks,
Ashutosh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141208/b8f949b9/attachment.html>


More information about the llvm-dev mailing list