<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div dir="ltr" class=""><div class="">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.</div></div></blockquote><div><br class=""></div><div>What size are you talking about? The number of IR instruction?</div><div><br class=""></div><div>Some time ago, I was working on something similar (maybe my information can be outdatedā€¦).</div><div><br class=""></div><div>You can look at the <i class="">CodeExtractor</i> class and the method <i class="">extractCodeRegion</i>.</div><div><br class=""></div><div>This can help you identifie the part of the function you can split.</div><div><br class=""></div><div>You can get the Region by adding the following method to your class: </div><div><br class=""></div><div><i class="">void getAnalysisUsage(AnalysisUsage &AU) const {  </i></div><div><i class="">  AU.addRequired<RegionInfoPass>();</i></div><div><i class="">}</i></div><div><br class=""></div><div>and you get the region with <i class="">RegionInfo* RI = &getAnalysis<RegionInfoPass>(*f).getRegionInfo();</i></div><div><br class=""></div><div>Good luck,</div><div><br class=""></div><div>Johan</div></div></div></body></html>