Hello, I have a situation to break/split function at llvm ir level of single function (if ir of single is more). 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. Thank you in advance. Kind regards Deep -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160129/5164762f/attachment.html>
You can probably use CodeExtractor for this purpose. It does function outlining. Regards, Ashutosh From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Sandeep Kumar Singh via llvm-dev Sent: Friday, January 29, 2016 3:24 PM To: LLVM Developers Mailing List Subject: [llvm-dev] Split llvm ir Hello, I have a situation to break/split function at llvm ir level of single function (if ir of single is more). 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. Thank you in advance. Kind regards Deep -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160129/604f3a75/attachment.html>
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>