[llvm-dev] Split llvm ir

Wehrli Johan via llvm-dev llvm-dev at lists.llvm.org
Fri Jan 29 02:16:29 PST 2016


Hi,

> Can someone clarify, is it possible to get the size at llvm ir level of function and how to split it without affecting functionality of splitted function.

What size are you talking about? The number of IR instruction?

Some time ago, I was working on something similar (maybe my information can be outdatedā€¦).

You can look at the CodeExtractor class and the method extractCodeRegion.

This can help you identifie the part of the function you can split.

You can get the Region by adding the following method to your class:

void getAnalysisUsage(AnalysisUsage &AU) const {
  AU.addRequired<RegionInfoPass>();
}

and you get the region with RegionInfo* RI = &getAnalysis<RegionInfoPass>(*f).getRegionInfo();

Good luck,

Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160129/2ffcfd77/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160129/2ffcfd77/attachment.sig>


More information about the llvm-dev mailing list