RE: Changes in ‘CodeExtractor’ for call-site block

Nema, Ashutosh Ashutosh.Nema at amd.com
Fri Jan 16 01:34:08 PST 2015


Sorry I didn’t noticed in my previous patch line context was missing, attaching patch with detailed context.

Regards,
Ashutosh

From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Nema, Ashutosh
Sent: Friday, January 16, 2015 2:54 PM
To: llvm-commits at cs.uiuc.edu
Subject: Changes in ‘CodeExtractor’ for call-site block

Hi,

This change is to expose call site block of outlined function in ‘CodeExtractor’.

When code extractor works on blocks inside a loop it extracts properly.
But it didn’t register extracted function call site block to loop.
Because of it loop verification fails with error:
"Loop block has no in-loop successors!".

Call site block registration to loop is very much needed.
I like to expose call site block (‘codeReplacer’) by adding getter functions to ‘CodeExtractor’ class.
So who ever using code extractor they can access that call-site block and register if needed.

Made following changes in CodeExtractor.

1) Made ‘codeReplacer’ as member of ‘CodeExtractor’

2) Added a new method ‘getCodeReplacerIfAvailable’ to ‘CodeExtractor’ class.
This method return ‘codeReplacer’ block.

3) ‘constructFunction’ method works on ‘codeReplacer’ block and accepts as argument.
Now ‘codeReplacer’ block is a member to class so no need of passing it as argument.

4) ‘emitCallAndSwitchStatement’ method works on ‘codeReplacer’ block and accepts as argument.
Now ‘codeReplacer’ block is a member to class so no need of passing it as argument.

5) Updated callsites to  ‘constructFunction’ & ‘emitCallAndSwitchStatement’.

6) In ‘CodeExtractor’ constructor setting ‘CodeReplacer’ as nullptr.

Files Modified:
include/llvm/Transforms/Utils/CodeExtractor.h
lib/Transforms/Utils/CodeExtractor.cpp

Requesting to review attached patch, comments are welcome.

Regards,
Ashutosh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150116/873cbc0c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patchCodeExtractor.patch
Type: application/octet-stream
Size: 40047 bytes
Desc: patchCodeExtractor.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150116/873cbc0c/attachment.obj>


More information about the llvm-commits mailing list