[PATCH] Changes in ‘CodeExtractor’ for call-site block

Ashutosh Nema ashutosh.nema at amd.com
Wed Jan 21 21:21:10 PST 2015


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

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7118

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

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7118.18581.patch
Type: text/x-patch
Size: 10434 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150122/1a4b628f/attachment.bin>


More information about the llvm-commits mailing list